File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -116,20 +116,17 @@ async function getSharedOutput() {
116116 data : transformedData
117117 }
118118
119- // Ensure fallback directory exists
120- if ( ! existsSync ( FALLBACK_DIR ) ) {
121- mkdirSync ( FALLBACK_DIR , { recursive : true } )
122- }
123-
124- // In development, add timestamp to filename and clean up old files
119+ // Only create directory and write files in development
125120 if ( process . env . NODE_ENV !== 'production' ) {
121+ // Ensure fallback directory exists
122+ if ( ! existsSync ( FALLBACK_DIR ) ) {
123+ mkdirSync ( FALLBACK_DIR , { recursive : true } )
124+ }
125+
126126 const timestamp = new Date ( ) . toISOString ( ) . replace ( / [: .] / g, '-' )
127127 const backupFile = join ( FALLBACK_DIR , `kg-data-${ timestamp } .json` )
128128 writeFileSync ( backupFile , JSON . stringify ( backupData , null , 2 ) )
129129 cleanupFallbackData ( )
130- } else {
131- // In production, use the standard filename (handled by GitHub Actions)
132- writeFileSync ( FALLBACK_FILE , JSON . stringify ( backupData , null , 2 ) )
133130 }
134131
135132 return transformedData
You can’t perform that action at this time.
0 commit comments