Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/nc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ program
.option("-h, --id <type>", "Id")
.option("-m, --image <type>,", "Image")
.option("-n, --instance <type>,", "Instance")
.option("-rg, --region,", "Region")
.option("-av, --apiversion,", "API Version")
.parse(process.argv);

Services(program, spinner);
24 changes: 20 additions & 4 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Init {
switch (providers) {
case "AWS":
this.createConfigFile({
package: "nodecloud-aws-plugin@1.0.0-beta.0",
package: "nodecloud-aws-plugin",
require: "nodeCloudAwsPlugin",
provider: `{
name: "aws",
Expand Down Expand Up @@ -150,7 +150,7 @@ class Init {
break;
default:
this.createConfigFile({
package: "nodecloud-aws-plugin@1.0.0-beta.0",
package: "nodecloud-aws-plugin",
require: "nodeCloudAwsPlugin",
provider: `{
name: "aws",
Expand Down Expand Up @@ -191,14 +191,30 @@ class Init {
}
])
.then(answers => {
console.log("provider", this._provider);

console.log("regions", answers.regions);
})
.catch(err => {
this._spinner.fail(err);
});
}

selectAPIVersion() {
inquirer
.prompt([
{
message: "Select API version",
type: "list",
name: "apiversions",
choices: ["2016-11-15"]
}
])
.then(answers => {
console.log("API Version Selected:", answers.apiversions);
})
.catch(err => {
this._spinner.fail(err);
});
}
}

module.exports = Init;
15 changes: 14 additions & 1 deletion lib/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,26 @@ function Services(program, spinner) {
if (program.about) {
logofied("NodeCloud CLI");
}

if (program.init) {
console.log("Test");
let Initialize = new Init(program, spinner);
Initialize.selectProvider();
} else if (!program.about) {
} else if (!program.init) {
core = new Core();
ncProviders = core.ncProviders();
}

if (program.region) {
let Initialize = new Init(program, spinner);
Initialize.selectRegion();
}

if (program.apiversion) {
let Initialize = new Init(program, spinner);
Initialize.selectAPIVersion();
}

if (program.compute) {
let compute = new Compute(program, ncProviders, options);
switch (program.compute) {
Expand Down
Loading