Skip to content

Commit 1b9feef

Browse files
committed
fix(ci): sync-ui 匹配前统一 LF 行尾,修复 Windows runner 检出 CRLF 失败
1 parent d7f4105 commit 1b9feef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎desktop/scripts/sync-ui.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ if (!existsSync(srcHtml) || !existsSync(srcStatic)) {
2222
mkdirSync(destDir, { recursive: true });
2323

2424
// ── 1. index.html:去 Jinja、修正相对路径 ──
25-
let html = readFileSync(srcHtml, "utf-8");
25+
// 统一为 LF 再匹配,避免 Windows runner 检出 CRLF 导致多行片段匹配失败
26+
let html = readFileSync(srcHtml, "utf-8").replace(/\r\n/g, "\n");
2627
const htmlReplacements = [
2728
[`{{ url_for('static', filename='css/app.css') }}`, "static/css/app.css"],
2829
[`{{ url_for('static', filename='js/vendor/lucide.min.js') }}`, "static/js/vendor/lucide.min.js"],
@@ -45,7 +46,7 @@ cpSync(srcStatic, destStatic, { recursive: true });
4546

4647
// ── 3. app.js:fetch → Tauri invoke ──
4748
const appJsPath = join(destStatic, "js", "app.js");
48-
let js = readFileSync(appJsPath, "utf-8");
49+
let js = readFileSync(appJsPath, "utf-8").replace(/\r\n/g, "\n");
4950

5051
const jsReplacements = [
5152
// 头部注入 invoke 桥接

0 commit comments

Comments
 (0)