Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chsrc set flutter 错误 #55

Closed
cikichen opened this issue Aug 28, 2024 · 3 comments
Closed

chsrc set flutter 错误 #55

cikichen opened this issue Aug 28, 2024 · 3 comments
Assignees
Labels
pl_target pl target
Milestone

Comments

@cikichen
Copy link

cikichen commented Aug 28, 2024

 ~  chsrc set flutter
[chsrc 检查] ✓ 命令 curl 存在
测速 https://mirrors.tuna.tsinghua.edu.cn/ ... 12.21 MByte/s
测速 https://mirrors.tencent.com/ ... 10.89 MByte/s
测速 https://mirrors.nju.edu.cn/ ... 9.84 MByte/s
最快镜像站: 清华大学开源软件镜像站
选中镜像站: TUNA (tuna)
--------------------------------
sh: /Users/ccc: Is a directory
[chsrc 运行] mkdir -p ~/.bashrc >> ~ 1>/dev/null 2>&1
sh: /Users/ccc: Is a directory
[chsrc 运行] x 命令执行失败,返回码 256
chsrc: 关键错误,强制结束
@ccmywish ccmywish self-assigned this Aug 28, 2024
@ccmywish ccmywish added the pl_target pl target label Aug 28, 2024
@ccmywish ccmywish added this to the v0.1.9 milestone Aug 28, 2024
@ccmywish
Copy link
Contributor

@cikichen

你好,上述失败是因为在recipe中错误地使用了早已经修改的函数。Dart和Flutter的换源长时间没有人测试,非常感谢你的反馈。

我已经修复recipe中的代码,并发布了 v0.1.8.1Homebrew 的同步更新可能需要一天的时间,在此之前,你可使用 README 中提供的链接来手动下载试用。

若试用换源无问题,可关闭此 issue

@cikichen
Copy link
Author

cikichen commented Aug 29, 2024

@ccmywish 可以了,但是有bug

[chsrc 检查] ✓ 命令 curl 存在
测速 https://mirrors.tuna.tsinghua.edu.cn/ ... 12.77 MByte/s
测速 https://mirrors.tencent.com/ ... 14.82 MByte/s
测速 https://mirrors.nju.edu.cn/ ... 13.94 MByte/s
最快镜像站: 腾讯软件源
选中镜像站: Tencent (tencent)
--------------------------------
[chsrc 运行] cp -f ~/.zshrc ~/.zshrc.bak
[chsrc 提示] 备份文件名为 ~/.zshrc.bak
[chsrc 运行] echo 'export PUB_HOSTED_URL="https://mirrors.cloud.tencent.com/dart-pub"' >> ~/.zshrc
[chsrc 运行] echo 'export FLUTTER_STORAGE_BASE_URL="https://mirrors.cloud.tencent.com/flutter"' >> ~/.zshrc
--------------------------------
chsrc: 感谢镜像提供方: 腾讯软件源
chsrc: 该换源步骤已实现但未经测试或存在任何反馈,请报告使用情况: chsrc issue

zshrc里面多次设置会出现重复的环境变量,如果手动设置过镜像地址,也不会替换原本的,而且继续在下面新增,现在zshrc里面是这样的:

# 手动
export PUB_HOSTED_URL=https://mirrors.cloud.tencent.com/dart-pub/
export FLUTTER_STORAGE_BASE_URL=https://mirrors.cloud.tencent.com/flutter/

# Generated by chsrc v0.1.8-2024/08/23
export HOMEBREW_API_DOMAIN="https://mirrors.sustech.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.sustech.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.sustech.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.sustech.edu.cn/git/homebrew/homebrew-core.git"


# Generated by chsrc v0.1.8-2024/08/23
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export PUB_HOSTED_URL="https://mirrors.cloud.tencent.com/dart-pub"
export FLUTTER_STORAGE_BASE_URL="https://mirrors.cloud.tencent.com/flutter"

@ccmywish
Copy link
Contributor

@cikichen

是的,目前所有通过写入 profile 的换源方案都是这么做的——往里写,但从不删。所以在 chsrc ls homebrew 中最后给了一个备注:

image

之后将考虑支持覆盖掉之前写入的源,我打开了一个新的issue:#58

如果 DartFlutter 本身的换源没有问题,可关闭此 issue 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pl_target pl target
Projects
None yet
Development

No branches or pull requests

2 participants