Skip to content

Commit

Permalink
feat(bin): add json vars param
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefano committed Jan 10, 2023
1 parent b1f915c commit 6c494ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const { values: processArgs } = parseArgs({
short: 'i',
multiple: true,
},
jsonvars: {
type: 'string',
short: 'j',
multiple: false
}
},
});

Expand All @@ -42,7 +47,9 @@ try {
}

process.env.IS_DRY = processArgs.dryRun;
await Main(processArgs, { ...process.env });
const jsonVars = processArgs.jsonvars ? JSON.parse(processArgs.jsonvars) : {};

await Main(processArgs, { ...process.env, ...jsonVars });
process.exit(0);
} catch (error) {
if (processArgs.verbose) {
Expand Down

0 comments on commit 6c494ec

Please sign in to comment.