1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-17 23:13:03 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
KenanZhu 6d05d4c7cb ci: main 分支 push 事件触发 BuildTest 工作流 2026-06-17 10:29:54 +08:00
KenanZhu 01f4ccaa0e fix(driver): macOS/Linux 下载的 Chrome/Edge 驱动缺少执行权限导致运行失败
zipfile 解压不保留 Unix 执行位,extract 后 chmod 755;同时在启动检查
时对已下载但不可执行的旧驱动自动修复权限。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-17 10:22:33 +08:00
3 changed files with 11 additions and 0 deletions
+3
View File
@@ -4,6 +4,9 @@ name: Build Test
# It is triggered when a pull request is opened, synchronized, or reopened against the main branch. # It is triggered when a pull request is opened, synchronized, or reopened against the main branch.
on: on:
push:
branches:
- main
pull_request: pull_request:
branches: branches:
- main - main
@@ -360,6 +360,10 @@ class WebDriverDownloader:
break break
if not driver_file: if not driver_file:
raise FileNotFoundError(f"未找到 web driver 文件 : {expected_name}") raise FileNotFoundError(f"未找到 web driver 文件 : {expected_name}")
# Ensure executable permissions on Unix systems (zipfile
# extraction does not preserve the execute bit).
if os.name != 'nt':
os.chmod(driver_file, 0o755)
progress_callback(100, 100, 0.0, "解压完成") progress_callback(100, 100, 0.0, "解压完成")
self.download_path.unlink() self.download_path.unlink()
self._cleanup(driver_file) self._cleanup(driver_file)
+4
View File
@@ -111,6 +111,10 @@ class WebDriverManager:
for driver_info in self.__driver_infos: for driver_info in self.__driver_infos:
driver_path = self._getDriverPath(driver_info) driver_path = self._getDriverPath(driver_info)
if driver_path and driver_path.exists() and driver_path.is_file(): if driver_path and driver_path.exists() and driver_path.is_file():
# Repair missing execute permission on Unix
# (zip-extracted drivers from older versions).
if os.name != 'nt' and not os.access(str(driver_path), os.X_OK):
os.chmod(str(driver_path), 0o755)
driver_info.driver_path = driver_path driver_info.driver_path = driver_path
driver_info.driver_status = WebDriverStatus.INSTALLED driver_info.driver_status = WebDriverStatus.INSTALLED