Browse Source

add back --no-open option to force skip donate prompt

master
Feross Aboukhadijeh 7 years ago
parent
commit
42c2ccef65
  1. 12
      cmd.js

12
cmd.js

@ -55,9 +55,15 @@ init()
async function init () { async function init () {
const argv = minimist(process.argv.slice(2), { const argv = minimist(process.argv.slice(2), {
boolean: [
'open'
],
alias: { alias: {
h: 'help', h: 'help',
v: 'version' v: 'version'
},
default: {
open: true
} }
}) })
const cwd = argv._[0] || process.cwd() const cwd = argv._[0] || process.cwd()
@ -68,7 +74,7 @@ async function init () {
if (argv.version) { if (argv.version) {
return runVersion() return runVersion()
} }
runThanks(cwd) runThanks(cwd, argv.open)
} }
function runHelp () { function runHelp () {
@ -93,7 +99,7 @@ function runVersion () {
console.log(require('./package.json').version) console.log(require('./package.json').version)
} }
async function runThanks (cwd) { async function runThanks (cwd, promptToOpen) {
spinner = ora({ spinner = ora({
spinner: HEARTS_SPINNER, spinner: HEARTS_SPINNER,
text: chalk`Getting ready to {cyan give thanks} to {magenta maintainers}...` text: chalk`Getting ready to {cyan give thanks} to {magenta maintainers}...`
@ -159,7 +165,7 @@ async function runThanks (cwd) {
printTable(authorsSeeking, pkgNamesSeeking, authorsPkgNames, directPkgNames) printTable(authorsSeeking, pkgNamesSeeking, authorsPkgNames, directPkgNames)
if (donateLinks.length) { if (donateLinks.length && promptToOpen) {
const prompt = new PromptConfirm( const prompt = new PromptConfirm(
chalk`Want to open these {cyan donate pages} in your {magenta web browser}? 🦄` chalk`Want to open these {cyan donate pages} in your {magenta web browser}? 🦄`
) )

Loading…
Cancel
Save