@sparkbox/carbon-cli
Advanced tools
Comparing version 0.5.1 to 0.5.2-2161743.0
@@ -20,2 +20,6 @@ #!/usr/bin/env node | ||
const { sourceRepo, branch, projectName, projectDir, shouldCreateRemote } = projectOptions; | ||
util_1.reviewOptions(projectOptions); | ||
const proceed = await prompts_1.confirmOptions(); | ||
if (!proceed) | ||
return; | ||
status.start(`initialize repo`); | ||
@@ -22,0 +26,0 @@ await util_1.run(`mkdir ${projectName} && cd ${projectName} && git init`); |
@@ -62,2 +62,14 @@ "use strict"; | ||
exports.buildOptions = buildOptions; | ||
async function confirmOptions() { | ||
const { confirmation } = await inquirer_1.prompt([ | ||
{ | ||
type: 'confirm', | ||
name: 'confirmation', | ||
message: 'proceed 👍', | ||
default: false, | ||
}, | ||
]); | ||
return confirmation; | ||
} | ||
exports.confirmOptions = confirmOptions; | ||
//# sourceMappingURL=project-options.js.map |
@@ -10,5 +10,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const boxen_1 = __importDefault(require("boxen")); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const boxen_1 = __importDefault(require("boxen")); | ||
const { red, gray, magenta } = chalk_1.default; | ||
const { red, gray, magenta, cyan, yellow } = chalk_1.default; | ||
function message(...args) { | ||
@@ -21,2 +21,18 @@ console.log(...args); | ||
}; | ||
function reviewOptions(projectOptions) { | ||
const summary = `Please Review | ||
${gray.bold('from:')} ${magenta(projectOptions.sourceRepo)}:${magenta(projectOptions.branch)} | ||
${gray.bold('to:')} ${cyan(projectOptions.projectDir)} | ||
${projectOptions.shouldCreateRemote | ||
? `This will create a new ${yellow(projectOptions.owner)} repo on GitHub` | ||
: 'This will not create a new repo on GitHub'}`; | ||
console.log(boxen_1.default(summary, { | ||
padding: 1, | ||
borderColor: 'gray', | ||
borderStyle: "round" /* Round */, | ||
})); | ||
} | ||
exports.reviewOptions = reviewOptions; | ||
function overview(projectOptions, newRemote) { | ||
@@ -23,0 +39,0 @@ let summary = `success! |
{ | ||
"name": "@sparkbox/carbon-cli", | ||
"version": "0.5.1", | ||
"version": "0.5.2-2161743.0", | ||
"description": "Project Setup Automation", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
192529
408