Skip to content

Commit 13218cf

Browse files
committed
Support new create-react-app via package version
1 parent 1a4ae16 commit 13218cf

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

createReactWpTheme.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const _createReactAppVersion = _wpThemeVersion.split('-')[0];
5656

5757
// Check this!!!!
5858
const _getScriptsPath = function() {
59-
return scriptsFromFile();
59+
return scriptsFromNpm();
6060
};
6161

6262
const scriptsFromNpm = function() {
@@ -191,7 +191,6 @@ function createApp(
191191
fs.ensureDirSync(name);
192192

193193
console.log(`Creating a new React WP theme in ${chalk.green(root)}.`);
194-
//printCreateReactAppVersion();
195194
console.log();
196195

197196
const useYarn = useNpm ? false : shouldUseYarn();
@@ -295,7 +294,7 @@ function createReactApp(createWpThemeReactRoot, appName, version, verbose, origi
295294
let command = "npx";
296295

297296
let args = [];
298-
args.push("create-react-app@" + _createReactAppVersion);
297+
args.push(`create-react-app@">=` + _createReactAppVersion + `"`);
299298
args.push(createWpThemeReactRoot);
300299

301300
if (verbose) {
@@ -468,12 +467,6 @@ function checkIfOnline(useYarn) {
468467
});
469468
}
470469

471-
function printCreateReactAppVersion() {
472-
console.log(chalk.green(`Checking create-react-app version, please wait...`));
473-
let craVersion = execSync(`npx create-react-app@${_createReactAppVersion} --version`);
474-
console.log(chalk.cyan(`Using create-react-app version: ${craVersion}`));
475-
}
476-
477470
function deleteFolderRecursive(path) {
478471
if (fs.existsSync(path)) {
479472
fs.readdirSync(path).forEach(function(file) {

0 commit comments

Comments
 (0)