From 59ff0b59e08db92fd9f7b62f874c3efa7b54d947 Mon Sep 17 00:00:00 2001 From: Max Stoiber Date: Sun, 24 Jul 2016 09:28:59 +0200 Subject: [PATCH] Fix --version (#152) --- global-cli/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) {