forked from LeoPlatform/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leo-cli-configure.js
39 lines (34 loc) · 939 Bytes
/
leo-cli-configure.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
39
#!/usr/bin/env node
var path = require('path');
var program = require('commander');
var colors = require('colors');
const utils = require("./lib/utils.js");
const watch = require("node-watch");
const fork = require("child_process").fork;
const generateProfile = require("leo-sdk/lib/generateProfile.js");
program
.version('0.0.1')
.option("-g, --global", "Install Globally")
.option("--awsprofile [profile]", "Region to run cloudformation")
.usage('<stack> <region> <dir> [options]')
.action(function(stack, region, dir, options) {
if (typeof dir === "object") {
options = dir;
dir = ".";
}
options = Object.assign({
global: false
}, options || {});
if (options.global) {
dir = null;
}
generateProfile(stack, Object.assign({
region: region
}, options), dir, (err) => {
console.log("done");
});
})
.parse(process.argv);
if (!process.argv.slice(2).length) {
program.outputHelp(colors.red);
}