Skip to content

Commit cb16f88

Browse files
committed
Don't redownload without --force
1 parent d07a8a7 commit cb16f88

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tools/gutenberg/download-gutenberg.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ async function main( force ) {
9595
process.exit( 1 );
9696
}
9797

98+
// Skip download if the gutenberg directory already exists and --force is not set.
99+
if ( ! force && fs.existsSync( gutenbergDir ) ) {
100+
console.log( '\n✅ The gutenberg directory already exists. Use --force to re-download.' );
101+
return;
102+
}
103+
98104
const zipName = `gutenberg-${ sha }.zip`;
99105
const zipPath = path.join( rootDir, zipName );
100106

@@ -180,7 +186,8 @@ async function main( force ) {
180186
}
181187

182188
// Run main function
183-
main().catch( ( error ) => {
189+
const force = process.argv.includes( '--force' );
190+
main( force ).catch( ( error ) => {
184191
console.error( '❌ Unexpected error:', error );
185192
process.exit( 1 );
186193
} );

0 commit comments

Comments
 (0)