UNPKG

@johnf/react-native-owl

Version:
54 lines (53 loc) 1.44 kB
#!/usr/bin/env node "use strict"; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import { buildHandler } from "./build.js"; import { runHandler } from "./run.js"; const argv = yargs(hideBin(process.argv)); const plaformOption = { alias: 'p', describe: 'Platform to build and run the app', demandOption: true, choices: ['ios', 'android'] }; const configOption = { alias: 'c', describe: 'Configuration file to be used', type: 'string', default: './owl.config.json' }; const updateOption = { alias: 'u', describe: 'Update the baseline screenshots', type: 'boolean', default: false }; const testPathPatternOption = { alias: 't', describe: 'Run Test for a matching path pattern', type: 'string', default: '' }; const builderOptionsRun = { config: configOption, platform: plaformOption }; const builderOptionsTest = { config: configOption, platform: plaformOption, update: updateOption, testPathPattern: testPathPatternOption }; argv.usage('Usage: $0 <command> [options]').command({ command: 'build', describe: 'Build the React Native project', builder: builderOptionsRun, handler: buildHandler }).command({ command: 'test', describe: 'Runs the test suite', builder: builderOptionsTest, handler: runHandler }).help('help').alias('h', 'help').showHelpOnFail(false, 'Specify --help for available options').alias('v', 'version').argv; //# sourceMappingURL=index.js.map