Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
11 changes: 8 additions & 3 deletions bin/nc.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,12 +2,17 @@
const program = require("commander");
const Services = require("../lib/services");
const ora = require("ora");

const package = require("../package.json");
const spinner = ora();

program
.version("0.0.1", "-v, --version")
.option("-a, --about", "View about section of NodeCloud CLI")
.version(
`
Version: ${package.version}
Github: ${package.repository}`,
"-v, --version"
)
.option("-a, --about", "View about section of NodeCloud CLI")
.option("-i, --init", "Initialize provider")
.option("-t, --type <type>", "Type")
.option("-j, --service <type>", "Service")
Expand Down
2 changes: 1 addition & 1 deletion lib/core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ class Core {
constructor() {
const nodecloud = require("nodecloud");
const optionsProvider = {
overrideProviders: false
overrideProviders: true
};
this._core = nodecloud.getProviders(optionsProvider);
}
Expand Down
22 changes: 19 additions & 3 deletions lib/helper.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const fs = require("fs");
const figlet = require("figlet");
const chalk = require("chalk");
const path = "./.nc.config.js";
const emoji = require("node-emoji");

/**
* Display text as CLI logo
Expand DownExpand Up@@ -37,9 +38,23 @@ let logofied = text => {
*/
let logger = (data, error) => {
if (error) {
console.log(chalk.red(`${JSON.stringify(data, null, 2)}`));
let exclamationMarks =
emoji.get("heavy_exclamation_mark") +
emoji.get("heavy_exclamation_mark") +
emoji.get("heavy_exclamation_mark");
console.log(
exclamationMarks +
"\n" +
chalk.red(chalk.bgWhite(`${JSON.stringify(data, null, 2)}`))
);
} else {
console.log(chalk.green(`${JSON.stringify(data, null, 2)}`));
let checkMarks =
emoji.get("white_check_mark") +
emoji.get("white_check_mark") +
emoji.get("white_check_mark");
console.log(
checkMarks + "\n" + chalk.green(`${JSON.stringify(data, null, 2)}`)
);
}
};

Expand All@@ -52,8 +67,9 @@ let checkPlugin = plugin => {
detectInstalled(plugin).then(exists => {
if (exists) {
resolve(true);
} else {
resolve(false);
}
resolve(false);
});
});
};
Expand Down
Loading