Repository navigation
fix(install): 变量名后紧跟全角字符时加花括号 - #38
Merged
Merged
Conversation
macOS 自带的 bash 3.2 会把紧跟变量的 UTF-8 首字节并进变量名,
`"$file("` 因此读的是 `$file(` 这个空变量。下载地址于是变成
`.../download/v1.2.0/`,真机安装直接 404。
dash/sh 不受影响,所以这个问题只在 macOS 和 bash 构建里出现。
同处 PowerShell 用 `${releases}.atom`,否则被当成字符串的属性查找。
Refs #37
`"$releases.atom"` 是字符串的属性查找,取到空值,feed 等于没读到;
改用 `${releases}.atom` 之后,`.Content` 又因为是 atom+xml 返回
byte[],正则匹配不到任何标签,最终报「未找到包含独立版文件的发布版」。
改为先 -OutFile 落盘再按 UTF-8 读文本,两条路径都绕开。
Refs #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修掉 #37 里唯一真正让 CI 变红的 bug,让 4 条测试腿变绿。发布链路的改动不在这个 PR。
基于 #37 的讨论,只保留安装脚本修复。
根因
macOS 自带的 bash 3.2 会把紧跟变量名的 UTF-8 首字节并进变量名:
这里读的其实是
$file((空变量),下载地址于是变成.../download/v1.2.0/,真机安装直接 404。#37 第二个 commit 修过一次,最后一个 merge commit 又退回去了。dash/sh 不这样解析,所以只有 bash 和 macOS 腿红;vitest 用
sh跑测试,因此 Linux 几条腿也红。改动
scripts/binary/install.sh:${file}、${version}加花括号,并去掉 fix(ci): tag 发布时创建 GitHub Release 并触发独立版打包 #37 里重复插入的download "$base/$asset"(它和后面按归档/裸二进制选择的下载逻辑冲突)。scripts/binary/install.ps1:"$releases.atom"会被当成字符串的属性查找,改成"${releases}.atom"。install.ps1:104的"$file("不用改:PowerShell 变量名不允许全角字符,不会误读。验证
在未修改的 main 上加回 #37 的写法,5 个用例失败,报错与 CI 里
linux-bash/linux-bash-node22/linux-bash-node24/macos-bash的失败逐字一致。不在本 PR
#37 的
release.yml部分(tag push 建 Release +workflow_call调binaries.yml)另开 PR 验证后再合;那条链路目前在本仓库一次都没实际运行过(release.yml在 tag push 的历史运行为 0,gh release list为空)。Dependency Review 的报错是仓库没开 Dependency graph,和代码无关:Settings → Code security → 打开 Dependency graph 即可。