Skip to content

Commit d24f98a

Browse files
lpalmesgaearon
authored andcommitted
Display yarn instead of yarnpkg when creating a new app (#1747)
* Display yarn instead of yarnpkg * Refactored displayd commands * Removed testing directory
1 parent 0811775 commit d24f98a

File tree

1 file changed

+8
-5
lines changed
  • packages/react-scripts/scripts

1 file changed

+8
-5
lines changed

packages/react-scripts/scripts/init.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -117,27 +117,30 @@ module.exports = function(appPath, appName, verbose, originalDirectory, template
117117
cdpath = appPath;
118118
}
119119

120+
// Change displayed command to yarn instead of yarnpkg
121+
var displayedCommand = useYarn ? 'yarn' : 'npm';
122+
120123
console.log();
121124
console.log('Success! Created ' + appName + ' at ' + appPath);
122125
console.log('Inside that directory, you can run several commands:');
123126
console.log();
124-
console.log(chalk.cyan(' ' + command + ' start'));
127+
console.log(chalk.cyan(' ' + displayedCommand + ' start'));
125128
console.log(' Starts the development server.');
126129
console.log();
127-
console.log(chalk.cyan(' ' + command + ' run build'));
130+
console.log(chalk.cyan(' ' + displayedCommand + ' run build'));
128131
console.log(' Bundles the app into static files for production.');
129132
console.log();
130-
console.log(chalk.cyan(' ' + command + ' test'));
133+
console.log(chalk.cyan(' ' + displayedCommand + ' test'));
131134
console.log(' Starts the test runner.');
132135
console.log();
133-
console.log(chalk.cyan(' ' + command + ' run eject'));
136+
console.log(chalk.cyan(' ' + displayedCommand + ' run eject'));
134137
console.log(' Removes this tool and copies build dependencies, configuration files');
135138
console.log(' and scripts into the app directory. If you do this, you can’t go back!');
136139
console.log();
137140
console.log('We suggest that you begin by typing:');
138141
console.log();
139142
console.log(chalk.cyan(' cd'), cdpath);
140-
console.log(' ' + chalk.cyan(command + ' start'));
143+
console.log(' ' + chalk.cyan(displayedCommand + ' start'));
141144
if (readmeExists) {
142145
console.log();
143146
console.log(chalk.yellow('You had a `README.md` file, we renamed it to `README.old.md`'));

0 commit comments

Comments
 (0)