Skip to content

Commit 9883fda

Browse files
committed
Merge branch '3.0.1'
2 parents 99e0aad + fb70516 commit 9883fda

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devloco/react-scripts-wptheme",
3-
"version": "3.0.1-wptheme-3.0.4",
3+
"version": "3.0.1-wptheme-3.0.5",
44
"description": "Configuration and scripts for Create React WP Theme.",
55
"repository": "devloco/create-react-wptheme",
66
"author": "devloco",

packages/react-scripts/scripts/wpbuild.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,28 @@ const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
6262

6363
const isInteractive = process.stdout.isTTY;
6464

65+
// wptheme -- added section
66+
// Make sure the PHP portion of setup has been done.
67+
if (wpThemePostInstallerInfo.postInstallerExists(paths)) {
68+
const displayedCommand = useYarn ? 'yarn' : 'npm';
69+
clearConsole();
70+
console.error(chalk.red('\nTheme failed to compile...\n'));
71+
console.log(
72+
"You haven't yet completed the PHP portion of your new theme's setup."
73+
);
74+
console.log(
75+
'You must: ' +
76+
chalk.magenta(`${displayedCommand} ${useYarn ? '' : 'run '}start`)
77+
);
78+
console.log(
79+
chalk.cyan(
80+
'And follow those instructions to complete the PHP portion of the setup.'
81+
)
82+
);
83+
console.log('Try building again after that is done.');
84+
process.exit(0);
85+
}
86+
6587
// Warn and crash if required files are missing
6688
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
6789
process.exit(1);
@@ -158,27 +180,6 @@ function build(previousFileSizes) {
158180
console.log();
159181
}
160182

161-
// print the post init instructions
162-
if (wpThemePostInstallerInfo.postInstallerExists(paths)) {
163-
const displayedCommand = useYarn ? 'yarn' : 'npm';
164-
clearConsole();
165-
console.error(chalk.red('\nTheme failed to compile...\n'));
166-
console.log(
167-
"You haven't yet completed the PHP portion of your new theme's setup."
168-
);
169-
console.log(
170-
'You must: ' +
171-
chalk.magenta(`${displayedCommand} ${useYarn ? '' : 'run '}start`)
172-
);
173-
console.log(
174-
chalk.cyan(
175-
'And follow those instructions to complete the PHP portion of the setup.'
176-
)
177-
);
178-
console.log('Try building again after that is done.');
179-
process.exit(0);
180-
}
181-
182183
console.log('Creating an optimized production build...');
183184

184185
const compiler = webpack(config);

0 commit comments

Comments
 (0)