1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 09:48:20 +08:00

Add: git-over-cdn

This commit is contained in:
LmeSzinc
2023-09-19 23:07:37 +08:00
parent a7f0a0231a
commit 1b9fd01852
5 changed files with 310 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
import os
from deploy.config import DeployConfig
from deploy.git_over_cdn.client import GitOverCdnClient
from deploy.logger import logger
from deploy.utils import *
@@ -78,6 +77,18 @@ class GitManager(DeployConfig):
logger.hr('Show Version', 1)
self.execute(f'"{self.git}" --no-pager log --no-merges -1')
@property
def goc_client(self):
client = GitOverCdnClient(
url='https://vip.123pan.cn/1818706573/pack/LmeSzinc_AzurLaneAutoScript_master',
folder=self.root_filepath,
source='origin',
branch='master',
git=self.git,
)
client.logger = logger
return client
def git_install(self):
logger.hr('Update Alas', 0)
@@ -85,6 +96,10 @@ class GitManager(DeployConfig):
logger.info('AutoUpdate is disabled, skip')
return
if self.GitOverCdn:
if self.goc_client.update(keep_changes=self.KeepLocalChanges):
return
self.git_repository_init(
repo=self.Repository,
source='origin',