【问题标题】:Uninstall Amplify CLI with Curl使用 Curl 卸载 Amplify CLI
【发布时间】:2021-05-16 18:29:12
【问题描述】:

我已经安装了带有 curl 和 npm 的 Amplify CLI,我要保留一个,所以我卸载 curl 只是因为在我个人的情况下,npm 对我来说更容易更新,这是我用来安装它的命令:

curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL

如何卸载它?我正在使用 macOS

谢谢

【问题讨论】:

    标签: amazon-web-services curl aws-amplify aws-amplify-cli


    【解决方案1】:

    在我看来,您必须手动清理,但这并不难。

    二进制文件位于$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
    

    【讨论】:

      猜你喜欢
      • 2023-03-08
      • 2016-04-01
      • 2018-08-18
      • 2018-07-12
      • 1970-01-01
      • 1970-01-01
      • 2020-08-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多