/
luis-version.js
38 lines (32 loc) · 1.27 KB
/
luis-version.js
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
#!/usr/bin/env node
const chalk = require('chalk');
const program = require('commander');
const update = require('../src/updatemodel');
program.Command.prototype.unknownOption = function (flag) {
process.stderr.write(chalk.default.redBright(`\n Unknown arguments: ${process.argv.slice(2).join(' ')}\n`));
program.help();
process.exit();
};
program
.name('luis-version')
.description('Updates the application with the supporting .lu file ')
.option('--appId [appid]', 'The LUIS application')
.option('--authoringKey [sub key]', 'LUIS user authoring key')
.option('--region [region]', 'The region where the app is deployed')
.option('--publish', 'Publishes the new version of the application')
.option('--model [model file]', 'The .lu file supporting the application')
.option('--luisrc [luisrc file]', 'The .luisrc file we want to use, perhaps if we want to use a different LUIS app if you have an app per environment setup.')
.option('--verbose')
.parse(process.argv);
if(!program.model) {
process.stderr.write(chalk.default.redBright(`\n --model parameter missing\n`));
program.help();
process.exit();
return;
}
if (process.argv.length < 2) {
program.help();
process.exit();
return;
}
update.updateModel(program);