1010 * FIGMA_FILE_KEY (optional; default from code)
1111 * FIGMA_NODE_ID (optional; default from code)
1212 * DRY_RUN=1 (optional) Log actions without writing files
13+ * FORCE_SYNC=1 (optional) Bypass fast-path bail-out and re-download all SVGs
1314 */
1415
1516import fs from 'node:fs' ;
@@ -34,6 +35,7 @@ const FIGMA_ACCESS_TOKEN = process.env.FIGMA_ACCESS_TOKEN;
3435const FIGMA_FILE_KEY = '98HKKXL2dTle29ikJ3tzk7' ;
3536const FIGMA_NODE_ID = '1:1483' ;
3637const DRY_RUN = process . env . DRY_RUN === '1' ;
38+ const FORCE_SYNC = process . env . FORCE_SYNC === '1' ;
3739
3840if ( ! FIGMA_ACCESS_TOKEN || ! FIGMA_FILE_KEY ) {
3941 console . error ( 'Missing FIGMA_ACCESS_TOKEN.' ) ;
@@ -381,6 +383,7 @@ async function main(): Promise<void> {
381383 // 3) Fast-path bail-out: if set of names hasn't changed and sprite exists, stop early
382384 const existingIcons = readExistingIcons ( ) ;
383385 if (
386+ ! FORCE_SYNC &&
384387 existingIcons . length > 0 &&
385388 sameSet (
386389 existingIcons ,
@@ -391,6 +394,9 @@ async function main(): Promise<void> {
391394 log ( 'exit' , '🙅 No icon name changes detected. Skipping fetch/optimize/build.' ) ;
392395 return ;
393396 }
397+ if ( FORCE_SYNC ) {
398+ log ( 'force' , '🔄 Full sync enabled — re-downloading all icons.' ) ;
399+ }
394400
395401 // 4) Diff output (kept from original for visibility) and set a change summary
396402 let changesetSummary = '' ;
0 commit comments