소스 검색

fix: EOL newline in tr-format cmd

Sv443 8 달 전
부모
커밋
03f6e6c2b8
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)