Skip to content

Commit e96817d

Browse files
Japneet Singh ChawlaJapneet Singh Chawla
authored andcommitted
sys env variables
1 parent d7ceacc commit e96817d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

commands/utils/set_args.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,23 @@ function sync_args_from_cmd(args) {
322322
} else {
323323
lt_config["run_settings"]["reject_unauthorized"] = false;
324324
}
325+
326+
//Set the env variables
327+
let sys_env_vars = undefined;
328+
if ("sys-envs" in args) {
329+
sys_env_vars = args["sys-envs"].split(",");
330+
} else if (lt_config["run_settings"]["sys-envs"]) {
331+
sys_env_vars = lt_config["run_settings"]["sys-envs"].split(",");
332+
}
333+
334+
if (sys_env_vars) {
335+
let envs = {};
336+
for (env in sys_env_vars) {
337+
envs[sys_env_vars[env].split("=")[0]] = sys_env_vars[env].split("=")[1];
338+
}
339+
lt_config["run_settings"]["sys-envs"] = envs;
340+
}
341+
325342
//get specs from current directory if specs are not passed in config or cli
326343
if (
327344
(lt_config["run_settings"]["specs"] == undefined ||

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ const argv = require("yargs")
127127
alias: "build-tags",
128128
describe: "build tags",
129129
type: "string",
130+
})
131+
.option("sys-envs", {
132+
alias: "sys-env-variables",
133+
describe: "system environment variables",
134+
type: "string",
130135
});
131136
},
132137
function (argv) {

0 commit comments

Comments
 (0)