From f5b328d00f1b01bd4f634d195e4d7b887e6eee72 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 24 Jul 2016 09:18:17 +0200 Subject: [PATCH] Fix --version --- 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) {