mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 12:49:03 +08:00
Fix: Use adb, git, python in system if the one in deploy.yaml doesn't exists
This commit is contained in:
parent
307c9e75f5
commit
bf3a08b446
@ -20,7 +20,12 @@ def show_fix_tip(module):
|
||||
class AdbManager(DeployConfig):
|
||||
@cached_property
|
||||
def adb(self):
|
||||
return self.filepath('AdbExecutable')
|
||||
exe = self.filepath('AdbExecutable')
|
||||
if os.path.exists(exe):
|
||||
return exe
|
||||
|
||||
logger.warning(f'AdbExecutable: {exe} does not exist, use `adb` instead')
|
||||
return 'adb'
|
||||
|
||||
def adb_install(self):
|
||||
logger.hr('Start ADB service', 0)
|
||||
|
||||
@ -7,7 +7,12 @@ from deploy.utils import *
|
||||
class GitManager(DeployConfig):
|
||||
@cached_property
|
||||
def git(self):
|
||||
return self.filepath('GitExecutable')
|
||||
exe = self.filepath('GitExecutable')
|
||||
if os.path.exists(exe):
|
||||
return exe
|
||||
|
||||
logger.warning(f'GitExecutable: {exe} does not exist, use `git` instead')
|
||||
return 'git'
|
||||
|
||||
@staticmethod
|
||||
def remove(file):
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from deploy.config import DeployConfig
|
||||
@ -8,7 +9,13 @@ from deploy.utils import *
|
||||
class PipManager(DeployConfig):
|
||||
@cached_property
|
||||
def python(self):
|
||||
return self.filepath("PythonExecutable")
|
||||
exe = self.filepath("PythonExecutable")
|
||||
if os.path.exists(exe):
|
||||
return exe
|
||||
|
||||
current = sys.executable.replace("\\", "/")
|
||||
logger.warning(f'PythonExecutable: {exe} does not exist, use current python instead: {current}')
|
||||
return current
|
||||
|
||||
@cached_property
|
||||
def requirements_file(self):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user