Skip to content

Commit 17c002f

Browse files
committed
force create-react-app to use npm
1 parent 69319ba commit 17c002f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

createReactWpTheme.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,9 @@ function createApp(
215215
const useYarn = useNpm ? false : shouldUseYarn();
216216
const originalDirectory = process.cwd();
217217

218-
process.chdir(appName); // change into the newly created folder, then run create-react-app.
218+
process.chdir(root); // change into the newly created folder, then run create-react-app.
219219

220+
useYarn = false; // always use NPM for now.
220221
createWpTheme(
221222
root,
222223
appName,
@@ -278,7 +279,6 @@ function createWpTheme(
278279
usePnp,
279280
useTypescript
280281
);
281-
282282
})
283283
.catch((reason) => {
284284
console.log();
@@ -344,6 +344,9 @@ function createReactApp(createWpThemeReactRoot, appName, version, verbose, origi
344344
scriptsPath.callback();
345345
resolve();
346346
});
347+
})
348+
.catch((code) => {
349+
reject(code);
347350
});
348351
}
349352

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-react-wptheme",
3-
"version": "2.1.1-wptheme-2.0.5",
3+
"version": "2.1.1-wptheme-2.0.6",
44
"description": "Create React WP themes with no build configuration.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)