1 | #!/usr/bin/env node
|
2 |
|
3 |
|
4 | if (!require('semver').gte(process.version, '8.3.0')) {
|
5 | console.log('Version of node.js doesn\'t meet minimum requirement.');
|
6 | console.log('Please ensure system has node.js version 8.3.0 or higher.');
|
7 | process.exit(1);
|
8 | }
|
9 |
|
10 | require('module-alias/register');
|
11 | const commander = require('commander');
|
12 |
|
13 | require('@src/commands/configure').createCommand(commander);
|
14 | require('@src/commands/deploy').createCommand(commander);
|
15 | require('@src/commands/new').createCommand(commander);
|
16 | require('@src/commands/init').createCommand(commander);
|
17 | require('@src/commands/dialog').createCommand(commander);
|
18 |
|
19 | commander
|
20 | .description('Command Line Interface for Alexa Skill Kit')
|
21 | .command('smapi', 'list of Alexa Skill Management API commands')
|
22 | .command('util', 'tooling functions when using ask-cli to manage Alexa Skill')
|
23 | .version(require('../package.json').version)
|
24 | .parse(process.argv);
|
25 |
|
26 | const ALLOWED_ASK_ARGV_2 = ['configure', 'deploy', 'new', 'init', 'dialog', 'smapi', 'util', 'help', '-v', '--version', '-h', '--help'];
|
27 | if (process.argv[2] && ALLOWED_ASK_ARGV_2.indexOf(process.argv[2]) === -1) {
|
28 | console.log('Command not recognized. Please run "ask" to check the user instructions.');
|
29 | }
|