From 8c7f36021acb393bab11beaebfb2070ce4ef1b92 Mon Sep 17 00:00:00 2001 From: Martin Konicek Date: Mon, 12 Dec 2016 09:03:38 -0800 Subject: [PATCH] Fix instructions in 'react-native init' Summary: This was buggy and didn't print the folder we need to cd into. Reviewed By: mkonicek Differential Revision: D4313396 Ninja: OSS only fbshipit-source-id: 0e15baf818065b63e939def60a1366e2251aac7d --- local-cli/generator/printRunInstructions.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/local-cli/generator/printRunInstructions.js b/local-cli/generator/printRunInstructions.js index 7db8cda96..d553a73c9 100644 --- a/local-cli/generator/printRunInstructions.js +++ b/local-cli/generator/printRunInstructions.js @@ -13,22 +13,19 @@ var path = require('path'); function printRunInstructions(projectDir, projectName) { const absoluteProjectDir = path.resolve(projectDir); - const relativeProjectDir = path.relative(process.cwd(), absoluteProjectDir); - // If we're in the project directory already, no need to 'cd' into it - const needToCd = !!relativeProjectDir; // iOS const xcodeProjectPath = path.resolve(projectDir, 'ios', projectName) + '.xcodeproj'; const relativeXcodeProjectPath = path.relative(process.cwd(), xcodeProjectPath); console.log(chalk.white.bold('To run your app on iOS:')); - if (needToCd) { console.log(' cd ' + relativeProjectDir); } + console.log(' cd ' + absoluteProjectDir); console.log(' react-native run-ios'); console.log(' - or -'); console.log(' Open ' + relativeXcodeProjectPath + ' in Xcode'); console.log(' Hit the Run button'); // Android console.log(chalk.white.bold('To run your app on Android:')); + console.log(' cd ' + absoluteProjectDir); console.log(' Have an Android emulator running (quickest way to get started), or a device connected'); - if (needToCd) { console.log(' cd ' + relativeProjectDir); } console.log(' react-native run-android'); }