@@ -62,6 +62,28 @@ const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
6262
6363const 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
6688if ( ! 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