add react-native version output for -v/--version
This commit is contained in:
parent
65a9e505bd
commit
1dea58c7df
|
@ -221,8 +221,12 @@ function checkNodeVersion() {
|
|||
|
||||
function checkForVersionArgument() {
|
||||
if (process.argv.indexOf('-v') >= 0 || process.argv.indexOf('--version') >= 0) {
|
||||
var pjson = require('./package.json');
|
||||
console.log(pjson.version);
|
||||
console.log('react-native-cli: ' + require('./package.json').version);
|
||||
try {
|
||||
console.log('react-native: ' + require(REACT_NATIVE_PACKAGE_JSON_PATH()).version);
|
||||
} catch (e) {
|
||||
console.log('react-native: n/a - not inside a React Native project directory')
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue