Browse Source

修复不能pull的bug

liuyuqi-dellpc 1 year ago
parent
commit
aeec9f88e5

+ 1 - 1
.github/workflows/build.yml

@@ -59,5 +59,5 @@ jobs:
         with:
         with:
           msgtype: link
           msgtype: link
           title: 'build success'
           title: 'build success'
-          text: 'flutter_cocktail has been build success, please download from aliyun oss. [git.yoqi.me]'
+          text: 'repo_sync has been build success, please download from aliyun oss. [git.yoqi.me]'
           msg_url: '${{ steps.get_version.outputs.url }}'
           msg_url: '${{ steps.get_version.outputs.url }}'

+ 2 - 2
repo_sync/platform/coding/coding.py

@@ -182,7 +182,7 @@ class CodingIE(BasePlatform):
         result = subprocess.run(
         result = subprocess.run(
             ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
             ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_coding {current_branch}')
         os.system('git remote remove origin_coding')
         os.system('git remote remove origin_coding')
         os.chdir('..')
         os.chdir('..')
         print('pull success')
         print('pull success')
@@ -203,7 +203,7 @@ class CodingIE(BasePlatform):
         )
         )
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_coding {current_branch}')
         
         
         os.system('git push -u origin_coding')
         os.system('git push -u origin_coding')
         os.system('git remote remove origin_coding')
         os.system('git remote remove origin_coding')

+ 2 - 2
repo_sync/platform/gitee.py

@@ -83,7 +83,7 @@ class GiteeIE(BasePlatform):
         )
         )
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_gitee {current_branch}')
         os.system('git remote remove origin_gitee')
         os.system('git remote remove origin_gitee')
         os.chdir('..')
         os.chdir('..')
         print('pull from gitee success')
         print('pull from gitee success')
@@ -100,7 +100,7 @@ class GiteeIE(BasePlatform):
         )
         )
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_gitee {current_branch}')
         
         
         os.system('git push -u origin_gitee')
         os.system('git push -u origin_gitee')
         os.system('git remote remove origin_gitee')
         os.system('git remote remove origin_gitee')

+ 3 - 4
repo_sync/platform/github.py

@@ -73,8 +73,7 @@ class GithubIE(BasePlatform):
             local_repo_path = local_repo_path[:-1]
             local_repo_path = local_repo_path[:-1]
         repo_name = local_repo_path.split(os.path.sep)[-1]
         repo_name = local_repo_path.split(os.path.sep)[-1]
         print(f'pull repo:{self.username}/{repo_name} from github')
         print(f'pull repo:{self.username}/{repo_name} from github')
-        if not self.repo_exists(repo_name):
-            self.create_repo(repo_name)
+        
         os.chdir(local_repo_path)
         os.chdir(local_repo_path)
         os.system('git remote remove origin_github')
         os.system('git remote remove origin_github')
         os.system(
         os.system(
@@ -82,7 +81,7 @@ class GithubIE(BasePlatform):
         result = subprocess.run(
         result = subprocess.run(
             ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
             ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_github {current_branch}')
         os.system('git remote remove origin_github')
         os.system('git remote remove origin_github')
         os.chdir('..')
         os.chdir('..')
         print('pull from github success')
         print('pull from github success')
@@ -106,7 +105,7 @@ class GithubIE(BasePlatform):
         )
         )
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_github {current_branch}')
         
         
         os.system('git push -u origin_github')
         os.system('git push -u origin_github')
         os.system('git remote remove origin_github')
         os.system('git remote remove origin_github')

+ 2 - 2
repo_sync/platform/gitlab.py

@@ -100,7 +100,7 @@ class GitlabIE(BasePlatform):
         )
         )
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_gitlab {current_branch}')
         os.system("git remote remove origin_gitlab")
         os.system("git remote remove origin_gitlab")
         os.chdir("..")
         os.chdir("..")
         print(f"pull repo:{self.username}/{repo_name} from gitlab success")
         print(f"pull repo:{self.username}/{repo_name} from gitlab success")
@@ -125,7 +125,7 @@ class GitlabIE(BasePlatform):
         )
         )
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
         current_branch = result.stdout.strip()
         current_branch = result.stdout.strip()
-        os.system(f'git pull origin_gogs {current_branch}')
+        os.system(f'git pull origin_gitlab {current_branch}')
         
         
         os.system("git push -u origin_gitlab")
         os.system("git push -u origin_gitlab")
         os.system("git remote remove origin_gitlab")
         os.system("git remote remove origin_gitlab")

+ 1 - 1
scripts/sync.xys

@@ -7,7 +7,7 @@ $InitialPath = "<curpath>";
         $ok=gettoken($a, "3", "&");
         $ok=gettoken($a, "3", "&");
                 $operation=gettoken($operation1,2,"=");
                 $operation=gettoken($operation1,2,"=");
                 $platform=gettoken($platform1,2,"=");
                 $platform=gettoken($platform1,2,"=");
-                text runret("F:\dist\Develop\Python\crawl_github\dist\repo_sync.exe $operation --platform $platform --repo_path <curpath>","F:\dist\Develop\Python\crawl_github\dist\")
+                run "cmd /k cd /d F:\dist\Develop\Python\crawl_github\dist && repo_sync $operation --platform $platform --repo_path <curpath>"
 "_Cancel"
 "_Cancel"
 //   msg "Cancled by user";   
 //   msg "Cancled by user";   
 	sub "_EOF";  
 	sub "_EOF";