Parcourir la source

更新 'UpdateGitRep.js'

NiceTry12138 il y a 5 mois
Parent
commit
38b9fd7851
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      UpdateGitRep.js

+ 4 - 0
UpdateGitRep.js

@@ -28,6 +28,10 @@ class RepUrls{
 // 拉取 Git 仓库最新代码到指定路径
 function pullGitRepository(repositoryUrl, localPath) {
     if (fs.existsSync(localPath)) {
+      
+      	// 切换路径 我发现不切换路径 经常会出现一些 bug 	
+        process.chdir(localPath);
+      
         // 路径已存在则拉取最新代码
         console.log(`Pull ${repositoryUrl} to ${localPath}...`);