From bb573cc0c1dfe70cf71ca2d6541ba8b06f3a6024 Mon Sep 17 00:00:00 2001 From: Kirito Date: Thu, 29 Jan 2026 18:02:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=96=B0=E5=A2=9E=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=92=8C=E5=88=A0=E9=99=A4src=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A2=9E=E5=BC=BA=E4=BA=86=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86=E6=93=8D=E4=BD=9C=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/switchBundle.py | 18 +++++++++++++++++- python/switchBundleR.py | 17 ++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/python/switchBundle.py b/python/switchBundle.py index 6c0edc7..64f08c1 100644 --- a/python/switchBundle.py +++ b/python/switchBundle.py @@ -23,6 +23,7 @@ BundleConfig = { '2006': 'betterjack', '6007': 'BRWhot', '2008': 'slots', + '2005': 'christmas', } unlinkArray = [ @@ -36,6 +37,7 @@ unlinkArray = [ ] def remove_folder(path): + print('remove path: ', path) if os.path.exists(path): if os.path.isfile(path) or os.path.islink(path): os.remove(path) @@ -44,6 +46,16 @@ def remove_folder(path): remove_folder(os.path.join(path, filename)) os.rmdir(path) +# 上传src相共用文件 +SrcDir = BuildDir + '\\src\\' +SrcDst = SubgamePath + 'lib/src/' +rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + SrcDst + ' --recursive'], capture_output=True, text=True) +print('remove dir src result: ', rmResult) +cmd = 'call aws s3 cp '+ SrcDir +' '+SrcDst + ' --recursive --region ap-east-1' +result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) +print('upload dir src result: ', result) +remove_folder(SrcDir) + for filename in os.listdir(BuildDir): file_path = os.path.join(BuildDir, filename) if filename in unlinkArray: @@ -51,6 +63,10 @@ for filename in os.listdir(BuildDir): for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/assets/' + BundleConfig[gameid] +'/' + + rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + awsPath + ' --recursive'], capture_output=True, text=True) + print('remove game gameid: ', gameid, ' result: ', rmResult) + subgameDir = BuildDir + 'assets\\' + BundleConfig[gameid] +'\\' cmd = 'call aws s3 cp '+ subgameDir +' '+awsPath + ' --recursive --region ap-east-1' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) @@ -65,4 +81,4 @@ for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/' cmd = 'call aws s3 cp '+ BuildDir +' '+awsPath + ' --recursive --region ap-east-1' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) - print(result) \ No newline at end of file + print('upload game gameid: ', gameid, ' result: ', result) \ No newline at end of file diff --git a/python/switchBundleR.py b/python/switchBundleR.py index b471d5f..4e3565d 100644 --- a/python/switchBundleR.py +++ b/python/switchBundleR.py @@ -23,6 +23,7 @@ BundleConfig = { '2006': 'betterjack', '6007': 'BRWhot', '2008': 'slots', + '2005': 'christmas', } unlinkArray = [ @@ -36,6 +37,7 @@ unlinkArray = [ ] def remove_folder(path): + print('remove path: ', path) if os.path.exists(path): if os.path.isfile(path) or os.path.islink(path): os.remove(path) @@ -44,6 +46,15 @@ def remove_folder(path): remove_folder(os.path.join(path, filename)) os.rmdir(path) +SrcDir = BuildDir + '\\src\\' +SrcDst = SubgamePath + 'lib/src/' +rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + SrcDst + ' --recursive'], capture_output=True, text=True) +print('remove dir src result: ', rmResult) +cmd = 'call aws s3 cp '+ SrcDir +' '+SrcDst + ' --recursive --region eu-west-3' +result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) +print('upload dir src result: ', result) +remove_folder(SrcDir) + for filename in os.listdir(BuildDir): file_path = os.path.join(BuildDir, filename) if filename in unlinkArray: @@ -51,6 +62,10 @@ for filename in os.listdir(BuildDir): for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/assets/' + BundleConfig[gameid] +'/' + + rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + awsPath + ' --recursive'], capture_output=True, text=True) + print('remove game gameid: ', gameid, ' result: ', rmResult) + subgameDir = BuildDir + 'assets\\' + BundleConfig[gameid] +'\\' cmd = 'call aws s3 cp '+ subgameDir +' '+awsPath + ' --recursive --region eu-west-3' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) @@ -65,4 +80,4 @@ for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/' cmd = 'call aws s3 cp '+ BuildDir +' '+awsPath + ' --recursive --region eu-west-3' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) - print(result) \ No newline at end of file + print('upload game gameid: ', gameid, ' result: ', result) \ No newline at end of file