diff --git a/global-cli/index.js b/global-cli/index.js index 22bfddc1fca..bb2dfe6ec57 100644 --- a/global-cli/index.js +++ b/global-cli/index.js @@ -54,17 +54,16 @@ var argv = require('minimist')(process.argv.slice(2)); */ var commands = argv._; if (commands.length === 0) { + if (argv.version) { + console.log('create-react-app version: ' + require('./package.json').version); + process.exit(); + } console.error( 'Usage: create-react-app [--verbose]' ); process.exit(1); } -if (argv.version) { - console.log('create-react-app version: ' + require('./package.json').version); - process.exit(); -} - createApp(commands[0], argv.verbose, argv['scripts-version']); function createApp(name, verbose, version) {