Skip to content
  • Sponsor facebook/create-react-app

  • Notifications You must be signed in to change notification settings
  • Fork 27k
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't prompt to install serve if already installed #2761

Merged
merged 3 commits into from
Jul 10, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
dont prompt if serve is already installed
  • Loading branch information
OwenFlood committed Jul 10, 2017
commit 8848d086789edfe8e260491a8548b9d60b662a18
1 change: 1 addition & 0 deletions packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@
"detect-port-alt": "1.1.3",
"escape-string-regexp": "1.0.5",
"filesize": "3.3.0",
"global-modules": "^1.0.0",
"gzip-size": "3.0.0",
"html-entities": "1.2.1",
"inquirer": "3.1.1",
12 changes: 8 additions & 4 deletions packages/react-dev-utils/printHostingInstructions.js
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@

const chalk = require('chalk');
const url = require('url');
const modules = require('global-modules');
const fs = require('fs');

function printHostingInstructions(
appPackage,
@@ -121,10 +123,12 @@ function printHostingInstructions(
);
console.log('You may serve it with a static server:');
console.log();
if (useYarn) {
console.log(` ${chalk.cyan('yarn')} global add serve`);
} else {
console.log(` ${chalk.cyan('npm')} install -g serve`);
if (!fs.existsSync(`${modules}/serve`)) {
if (useYarn) {
console.log(` ${chalk.cyan('yarn')} global add serve`);
} else {
console.log(` ${chalk.cyan('npm')} install -g serve`);
}
}
console.log(` ${chalk.cyan('serve')} -s ${buildFolder}`);
console.log();