Przeglądaj źródła

使用 diff 命令 替换 status 命令,因为 status 会把新的文件一并展示出来

NiceTry12138 5 miesięcy temu
rodzic
commit
d772aa3981
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      UpdateGitRep.js

+ 2 - 1
UpdateGitRep.js

@@ -85,8 +85,9 @@ function checkEditFileRep(inPath)
     }
     }
     
     
     try {
     try {
+        // `git -C "${inPath}" status --porcelain`,
         const output = child_process.execSync(
         const output = child_process.execSync(
-            `git -C "${inPath}" status --porcelain`,
+            `git -C "${inPath}" diff --name-only`,
             { encoding: 'utf-8' }
             { encoding: 'utf-8' }
         );
         );
         if(output.trim().length > 0) 
         if(output.trim().length > 0)