Skip to content

Commit 59ff0b5

Browse files
mxstbrvjeux
authored andcommitted
Fix --version (#152)
1 parent f2c1275 commit 59ff0b5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

global-cli/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,16 @@ var argv = require('minimist')(process.argv.slice(2));
5454
*/
5555
var commands = argv._;
5656
if (commands.length === 0) {
57+
if (argv.version) {
58+
console.log('create-react-app version: ' + require('./package.json').version);
59+
process.exit();
60+
}
5761
console.error(
5862
'Usage: create-react-app <project-directory> [--verbose]'
5963
);
6064
process.exit(1);
6165
}
6266

63-
if (argv.version) {
64-
console.log('create-react-app version: ' + require('./package.json').version);
65-
process.exit();
66-
}
67-
6867
createApp(commands[0], argv.verbose, argv['scripts-version']);
6968

7069
function createApp(name, verbose, version) {

0 commit comments

Comments
 (0)