mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 03:26:07 +00:00
Warn if init
is called from existing project
This commit is contained in:
parent
f8a4467b7d
commit
4933034334
@ -21,6 +21,14 @@ function printUsage() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function printInitWarning() {
|
||||
console.log([
|
||||
'Looks like React Native project already exists in the current',
|
||||
'folder. Run this command from a different folder or remove node_modules/react-native'
|
||||
].join('\n'));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function run() {
|
||||
var args = process.argv.slice(2);
|
||||
if (args.length === 0) {
|
||||
@ -41,6 +49,9 @@ function run() {
|
||||
case 'bundle':
|
||||
bundle.init(args);
|
||||
break;
|
||||
case 'init':
|
||||
printInitWarning();
|
||||
break;
|
||||
default:
|
||||
console.error('Command `%s` unrecognized', args[0]);
|
||||
printUsage();
|
||||
|
Loading…
x
Reference in New Issue
Block a user