@@ -65,6 +65,13 @@ export async function processBuildTranslations(
6565 ( process . env . LINGO_BUILD_MODE as "translate" | "cache-only" ) ||
6666 config . buildMode ;
6767
68+ if ( buildMode !== "translate" && buildMode !== "cache-only" ) {
69+ logger . error (
70+ `❌ Invalid build mode: "${ buildMode } ". Must be "translate" or "cache-only".` ,
71+ ) ;
72+ process . exit ( 1 ) ;
73+ }
74+
6875 logger . info ( `🌍 Build mode: ${ buildMode } ` ) ;
6976
7077 if ( metadataFilePath ) {
@@ -123,7 +130,9 @@ export async function processBuildTranslations(
123130 : config . targetLocales ;
124131
125132 logger . info (
126- `Processing translations for ${ allLocales . length } locale(s)${ needsSourceLocale ? " (including source locale for pluralization)" : "" } ...` ,
133+ `Processing translations for ${ allLocales . length } locale(s)${
134+ needsSourceLocale ? " (including source locale for pluralization)" : ""
135+ } ...`,
127136 ) ;
128137
129138 const stats : BuildTranslationResult [ "stats" ] = { } ;
@@ -229,9 +238,9 @@ async function validateCache(
229238
230239 // Log first few missing hashes for debugging
231240 logger . debug (
232- `Missing hashes in ${ locale } : ${ missingHashes . slice ( 0 , 5 ) . join ( ", " ) } ${
233- missingHashes . length > 5 ? "..." : ""
234- } `,
241+ `Missing hashes in ${ locale } : ${ missingHashes
242+ . slice ( 0 , 5 )
243+ . join ( ", " ) } ${ missingHashes . length > 5 ? "..." : "" } `,
235244 ) ;
236245 }
237246 } catch ( error ) {
@@ -307,7 +316,9 @@ async function copyStaticFiles(
307316 ) ;
308317
309318 logger . info (
310- `✓ Generated ${ locale } .json (${ Object . keys ( entries ) . length } translations)` ,
319+ `✓ Generated ${ locale } .json (${
320+ Object . keys ( entries ) . length
321+ } translations)`,
311322 ) ;
312323 } catch ( error ) {
313324 logger . error ( `❌ Failed to generate ${ locale } .json:` , error ) ;
0 commit comments