Skip to content

Commit

Permalink
Merge pull request facebook#1142 from frantic/init-in-existing-project
Browse files Browse the repository at this point in the history
Warn if `init` is called from existing project
  • Loading branch information
vjeux committed May 14, 2015
2 parents ddde7e3 + 4933034 commit b63905f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions local-cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down

0 comments on commit b63905f

Please sign in to comment.