Skip to content

Commit

Permalink
feat(flag): add file flag to specify env.yml path (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Ross authored Jun 25, 2018
1 parent c1c87db commit 882f3b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ parser.addArgument(['-s', '--stage'], {
help: 'Environment stage',
dest: 'stage'
});
parser.addArgument(['-f', '--file'], {
help: 'Path to env.yml',
dest: 'file',
defaultValue: 'env.yml'
});

const args = parser.parseArgs();
const config = loadConfig();

let document: InputDocument;
try {
const contents = fs.readFileSync('env.yml', 'utf8')
const contents = fs.readFileSync(args.file, 'utf8')
document = parse(contents, args.stage);
} catch (error) {
console.error(`Could not load yaml ${error.stack}`);
Expand Down

0 comments on commit 882f3b0

Please sign in to comment.