如何解决使用 Curl 卸载 Amplify CLI
我已经安装了带有 curl 和 npm 的 Amplify CLI,我保留了一个,所以我卸载 curl 只是因为在我的个人情况下 npm 对我来说更容易更新,这是我用来安装它的命令:
curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL
我该如何卸载它?我使用的是 macOS
谢谢
解决方法
在我看来,您必须手动清理,但这并不难。
二进制文件位于 $HOME/.amplify/bin/amplify
。然后,根据您的 shell,您可以删除 installation script 添加的自定义路径和配置。
# Add to $PATH
SOURCE_STR="# Added by Amplify CLI binary installer\nexport PATH=\"\$HOME/.amplify/bin:\$PATH\"\n"
add_to_path () {
command printf "\n$SOURCE_STR" >> "$1"
printf "\n$yellow Added the following to $1:\n\n$SOURCE_STR$reset"
}
SHELLTYPE="$(basename "/$SHELL")"
if [[ $SHELLTYPE = "fish" ]]; then
command fish -c 'set -U fish_user_paths ~/.amplify/bin $fish_user_paths'
printf "\n$yellow Added ~/.amplify/bin to fish_user_paths universal variable$reset."
elif [[ $SHELLTYPE = "zsh" ]]; then
SHELL_CONFIG=$HOME/.zshrc
if [ ! -r $SHELL_CONFIG ] || (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
else
SHELL_CONFIG=$HOME/.bashrc
if [ ! -r $SHELL_CONFIG ] || (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
SHELL_CONFIG=$HOME/.bash_profile
if [[ -r $SHELL_CONFIG ]]; then
if [[ ! $(grep -q '.amplify/bin' $SHELL_CONFIG) ]]; then
add_to_path $SHELL_CONFIG
fi
else
SHELL_CONFIG=$HOME/.bash_login
if [[ -r $SHELL_CONFIG ]]; then
if [[ ! $(grep -q '.amplify/bin' $SHELL_CONFIG) ]]; then
add_to_path $SHELL_CONFIG
fi
else
SHELL_CONFIG=$HOME/.profile
if [ ! -r $SHELL_CONFIG ] || (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
fi
fi
fi
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。