Переглянути джерело

fix: EOL newline in tr-format cmd

Sv443 8 місяців тому
батько
коміт
270ce83459
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      src/tools/tr-format.ts

+ 4 - 0
src/tools/tr-format.ts

@@ -66,6 +66,10 @@ async function run() {
     if(localeObj.base)
       localeFile = localeFile.replace(/\s*\{\s*/, `{\n  "base": "${localeObj.base}",\n  `);
 
+    // add EOL newline if not present
+    if(!localeFile.endsWith("\n"))
+      localeFile += "\n";
+
     // overwrite original file
     // (backup is available through git history so idc)