From 924bb7208f5096ddd6f251cf3c20837af9ad570d Mon Sep 17 00:00:00 2001 From: hypercross Date: Mon, 24 Aug 2026 10:25:11 +0800 Subject: [PATCH] feat: add windows double-click launcher and update readme --- .gitattributes | 3 +++ README.md | 8 ++++++++ update-ssl.bat | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 update-ssl.bat diff --git a/.gitattributes b/.gitattributes index 97d156f..3e1c8aa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,5 @@ # Ensure shell scripts always use LF line endings, even on Windows/Git Bash. *.sh text eol=lf + +# Batch files must use CRLF line endings to run correctly on Windows. +*.bat text eol=crlf diff --git a/README.md b/README.md index 869abd1..f19a9a7 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ ## 使用方法 +### 方式一:Windows 双击运行(推荐) + +1. 在 Windows 上同步仓库(`git pull`)。 +2. 双击 `update-ssl.bat`。 +3. 脚本会自动打开 Git Bash 并运行,完成后按任意键关闭窗口。 + +### 方式二:终端运行(Mac / Linux) + 在终端里运行: ```bash diff --git a/update-ssl.bat b/update-ssl.bat new file mode 100644 index 0000000..839f019 --- /dev/null +++ b/update-ssl.bat @@ -0,0 +1,29 @@ +@echo off +REM update-ssl.bat - 双击运行 SSL 证书更新脚本 +REM 自动找到 Git Bash 并运行同目录下的 update-ssl.sh + +cd /d "%~dp0" + +REM 查找 Git Bash 的常见安装位置 +set "BASH=" +for %%p in ( + "C:\Program Files\Git\bin\bash.exe" + "C:\Program Files (x86)\Git\bin\bash.exe" + "%LOCALAPPDATA%\Programs\Git\bin\bash.exe" +) do ( + if exist %%p set "BASH=%%~p" +) + +if not defined BASH ( + echo 找不到 Git Bash,请先安装 Git for Windows。 + echo 下载地址: https://git-scm.com/download/win + pause + exit /b 1 +) + +echo 正在运行 SSL 证书更新脚本... +"%BASH%" -l -c "./update-ssl.sh" + +echo. +echo 脚本执行完毕,按任意键关闭窗口。 +pause >nul