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后,mac终端出现zsh: command not found 报错 #34

Closed
Maxinsomnia opened this issue Jun 12, 2024 · 6 comments
Closed

执行chsrc后,mac终端出现zsh: command not found 报错 #34

Maxinsomnia opened this issue Jun 12, 2024 · 6 comments
Assignees
Labels
Bug 存在缺陷 macOS macOS相关
Milestone

Comments

@Maxinsomnia
Copy link

问题如图,尝试history中的修复方式无效,请问该怎么办

SCR-20240612-ludq SCR-20240612-lshh
@ccmywish
Copy link
Contributor

你好 @Maxinsomnia

抱歉给你带来了麻烦。

看了你的历史记录,我唯一怀疑的是 chsrc set brew 有问题,因为之前仅有一个人测试过 homebrew 的换源。我刚才审阅了代码,有一些环境变量写入了你的 ~/.zshrc~/.bashrc 中,所以请你协助检查一下 ~/.zshrc 文件。

然后检查一下你的 $PATH 是什么。

@ccmywish ccmywish self-assigned this Jun 12, 2024
@ccmywish ccmywish added the Bug 存在缺陷 label Jun 12, 2024
@Maxinsomnia
Copy link
Author

感谢 @ccmywish

不好意思这么久才看到您的回复,通过link1link2的修复方法,删掉注入的配置之后就恢复正常了,目前还没发现什么问题。

是的,$PATH没有问题,如您所说,有一些变量进入~/.zshrc 文件,这是文件最后的配置信息。

image

@ccmywish ccmywish added the macOS macOS相关 label Jun 17, 2024
ccmywish added a commit that referenced this issue Jun 20, 2024
@ccmywish ccmywish added this to the v0.1.7 milestone Jun 20, 2024
@ccmywish
Copy link
Contributor

Hi @Maxinsomnia

我已经调整了代码。但是我看你的截图,不知道为什么~/.zshrc里写入的那几行末尾会是$,这是你截图的原因吗,还是文件内容就是那样?

你可下载试用最新版(通过README的链接下载),重新尝试chsrc set homebrew。现在chsrc默认会给你的~/.zshrc~/.bashrc备份,所以如果出现了问题,可以直接把备份的文件恢复过来。

@Maxinsomnia
Copy link
Author

好的谢谢,那可能是因为我有尝试其他的修复手段?我也记不清了

@ccmywish
Copy link
Contributor

@Maxinsomnia

可以再帮忙测试一下结果吗?如果没问题的话,我准备发布 v0.1.7 了。届时可以直接通过 brew install chsrc 安装。

@Maxinsomnia
Copy link
Author

Maxinsomnia commented Jun 29, 2024 via email

@ccmywish ccmywish closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 存在缺陷 macOS macOS相关
Projects
None yet
Development

No branches or pull requests

2 participants