Skip to content

Commit 8966534

Browse files
committed
Always run build:gutenberg -- --dev.
1 parent 5f16124 commit 8966534

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

Gruntfile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,13 @@ module.exports = function(grunt) {
15941594
args: [ 'tools/gutenberg/download.js' ],
15951595
opts: { stdio: 'inherit' }
15961596
}, function( error ) {
1597-
done( ! error );
1597+
if ( error ) {
1598+
done( false );
1599+
return;
1600+
}
1601+
grunt.option( 'dev', true );
1602+
grunt.task.run( 'build:gutenberg' );
1603+
done();
15981604
} );
15991605
} );
16001606

tools/gutenberg/utils.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,24 @@ function readGutenbergConfig() {
4242
}
4343

4444
/**
45-
* Trigger a fresh download of the Gutenberg artifact by spawning download.js.
46-
* Exits the process if the download fails.
45+
* Trigger a fresh download of the Gutenberg artifact by spawning download.js,
46+
* then immediately copy the build to src/ so the files are in place before
47+
* the build process runs copy:files.
48+
* Exits the process if either step fails.
4749
*/
4850
function downloadGutenberg() {
49-
const result = spawnSync( 'node', [ path.join( __dirname, 'download.js' ) ], { stdio: 'inherit' } );
50-
if ( result.status !== 0 ) {
51-
process.exit( result.status ?? 1 );
51+
const downloadResult = spawnSync( 'node', [ path.join( __dirname, 'download.js' ) ], { stdio: 'inherit' } );
52+
if ( downloadResult.status !== 0 ) {
53+
process.exit( downloadResult.status ?? 1 );
54+
}
55+
56+
const copyResult = spawnSync(
57+
'node',
58+
[ path.join( __dirname, 'copy.js' ), '--build-dir=src' ],
59+
{ stdio: 'inherit' }
60+
);
61+
if ( copyResult.status !== 0 ) {
62+
process.exit( copyResult.status ?? 1 );
5263
}
5364
}
5465

0 commit comments

Comments
 (0)