Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pghalliday committed Dec 17, 2018
1 parent c6a7db1 commit 32f0105
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ export const DEFAULT_CONFIG_PATH = 'firestore-schema.json';
export const DEFAULT_SCHEMA_PATH = 'firestore-schema/schema';
export const DEFAULT_MIGRATIONS_PATH = 'firestore-schema/migrations';

const CONFIG_OPTION = {
alias: 'config',
demandOption: false,
default: DEFAULT_CONFIG_PATH,
describe: 'Path to the config file',
type: 'string',
};

yargs
.version('v', packageJson.version)
.alias('v', 'version')
Expand Down Expand Up @@ -53,7 +45,13 @@ yargs
'Generate Google Cloud Firestore rules, indices, models and migrations',
(yargs) => {
yargs
.option('c', CONFIG_OPTION);
.option('c', {
alias: 'config',
demandOption: false,
default: DEFAULT_CONFIG_PATH,
describe: 'Path to the config file',
type: 'string',
});
},
(argv) => {
const config = require(path.resolve(argv.config));
Expand Down

0 comments on commit 32f0105

Please sign in to comment.