forked from alexa/ask-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathask.ts
executable file
·51 lines (45 loc) · 1.59 KB
/
ask.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env node
import semver from "semver";
if (!semver.gte(process.version, "8.3.0")) {
console.log("Version of node.js doesn't meet minimum requirement.");
console.log("Please ensure system has node.js version 8.3.0 or higher.");
process.exit(1);
}
import { Command } from 'commander';
const commander = new Command();
import {createCommand as configureCommand} from "../lib/commands/configure";
import {createCommand as deployCommand} from "../lib/commands/deploy";
import {createCommand as newCommand} from "../lib/commands/new";
import {createCommand as initCommand} from "../lib/commands/init";
import {createCommand as dialogCommand} from "../lib/commands/dialog";
import {createCommand as runCommand} from "../lib/commands/run";
[configureCommand, deployCommand, newCommand, initCommand, dialogCommand, runCommand].forEach(
(command) => command(commander),
);
commander
.description("Command Line Interface for Alexa Skill Kit")
.command("smapi", "list of Alexa Skill Management API commands")
.command("skill", "increase the productivity when managing skill metadata")
.command("util", "tooling functions when using ask-cli to manage Alexa Skill")
.version(require("../package.json").version)
.parse(process.argv);
const ALLOWED_ASK_ARGV_2 = [
"configure",
"deploy",
"new",
"init",
"dialog",
"smapi",
"skill",
"util",
"help",
"-v",
"--version",
"-h",
"--help",
"run",
];
if (process.argv[2] && ALLOWED_ASK_ARGV_2.indexOf(process.argv[2]) === -1) {
console.log('Command not recognized. Please run "ask" to check the user instructions.');
process.exit(1);
}