From 882f3b0a9a9c46fd0c8e627b68a2bc52ec5232cf Mon Sep 17 00:00:00 2001 From: Ben Ross Date: Mon, 25 Jun 2018 18:30:40 -0400 Subject: [PATCH] feat(flag): add file flag to specify env.yml path (#28) --- src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a91c25f..9ecac04 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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}`);