feat: one-click Scripto install in Settings - #46
Merged
Conversation
…Support), uv sync, auto-set folder Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…kout's dist build and relaunches Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
背景
Scripto 此前必须手动 clone 并在设置里指定目录。此改动在 PR #45 的描述中已包含,但对应提交(120f37c)push 时 #45 已被合并,未进入 main,故单独提交本 PR。另:2026-07-25 排查发现,存储根迁移到 iCloud 后 config.json 中没有 scripto_dir,点击转录只会提示先设置目录——本改动的「一键安装」按钮正是这种情况的一键修复(检测到已有 checkout 时直接采用)。
改动
ShiftlyKit.ScriptoInstall:纯逻辑的目标目录解析——app 位于 Shiftly git 检出内(如从 dist/ 运行)时克隆到检出的同级目录(../scripto);否则克隆到~/Library/Application Support/Shiftly/scripto(不受 app 搬家影响,避免把 Python venv 放进可能被 iCloud 同步的存储根)。AppModel.installScripto():目标处已有 checkout(含pyproject.toml)则直接采用不重复克隆;否则git clone→uv sync预热环境 → 自动写入scripto_dir。缺 uv / sync 失败时保留 checkout 并给出对应提示;克隆失败时清理本次创建的目录。AppModel.runShell(登录 zsh,先排空 stderr 再等退出,stdout 丢弃,避免管道写满死锁),转录调用改用它。验证
scripts/test.sh全部通过(114 用例,含新增 ScriptoInstall 目录解析/checkout 检测 3 项)。scripts/build_app.sh打包成功。git clone https://github.com/TN019/scripto.git到临时目录实测成功;登录 shell 可找到 uv。未自动化验证项
🤖 Generated with Claude Code