We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
--force
1 parent d07a8a7 commit cb16f88Copy full SHA for cb16f88
1 file changed
tools/gutenberg/download-gutenberg.js
@@ -95,6 +95,12 @@ async function main( force ) {
95
process.exit( 1 );
96
}
97
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
+
104
const zipName = `gutenberg-${ sha }.zip`;
105
const zipPath = path.join( rootDir, zipName );
106
@@ -180,7 +186,8 @@ async function main( force ) {
180
186
181
187
182
188
// Run main function
183
-main().catch( ( error ) => {
189
+const force = process.argv.includes( '--force' );
190
+main( force ).catch( ( error ) => {
184
191
console.error( '❌ Unexpected error:', error );
185
192
193
} );
0 commit comments