From 7d2695425d1c093b5a5d7ac827bb781a5db4e100 Mon Sep 17 00:00:00 2001 From: mrsauravsahu Date: Sun, 6 Sep 2026 19:59:24 +0530 Subject: [PATCH] Chore: drop non-asdf version managers asdf covers node, python, go, terraform and dotnet through plugins, so the standalone installers duplicated it. nvm, pyenv, gvm and tfenv were already flagged deprecated in favour of asdf; this removes them along with dotnet. Removed: - src/installers/{gvm,nvm,pyenv,tfenv,dotnet}.{install,configure}.zsh - src/extras/nvmrc-support.zsh, nvm-only and sourced by nothing Wiring: - read-options.zsh: dotnet dropped from the default tool set - configure.zsh: removed tools dropped from the configure list - tool-guards.zsh: DEPRECATED_TOOLS held only these five, and the invalid-tool check in read-options exits before validate_tools runs, so the deprecation warning was unreachable - removed --tools now rejects the removed names via the existing installer-file check; no new validation was needed. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_017opPVGYfryqcV8BAt66zqW --- details.md | 4 ++-- readme.md | 8 ++------ src/defs/configure.zsh | 2 +- src/extras/nvmrc-support.zsh | 21 ------------------- src/installers/dotnet.configure.zsh | 6 ------ src/installers/dotnet.install.zsh | 11 ---------- src/installers/gvm.configure.zsh | 10 --------- src/installers/gvm.install.zsh | 32 ----------------------------- src/installers/nvm.configure.zsh | 9 -------- src/installers/nvm.install.zsh | 16 --------------- src/installers/pyenv.configure.zsh | 8 -------- src/installers/pyenv.install.zsh | 31 ---------------------------- src/installers/tfenv.configure.zsh | 6 ------ src/installers/tfenv.install.zsh | 10 --------- src/utils/read-options.zsh | 2 +- src/utils/tool-guards.zsh | 9 -------- 16 files changed, 6 insertions(+), 179 deletions(-) mode change 100755 => 100644 readme.md delete mode 100755 src/extras/nvmrc-support.zsh delete mode 100755 src/installers/dotnet.configure.zsh delete mode 100755 src/installers/dotnet.install.zsh delete mode 100755 src/installers/gvm.configure.zsh delete mode 100755 src/installers/gvm.install.zsh delete mode 100755 src/installers/nvm.configure.zsh delete mode 100755 src/installers/nvm.install.zsh delete mode 100755 src/installers/pyenv.configure.zsh delete mode 100755 src/installers/pyenv.install.zsh delete mode 100755 src/installers/tfenv.configure.zsh delete mode 100755 src/installers/tfenv.install.zsh diff --git a/details.md b/details.md index a08272f..45eab8b 100755 --- a/details.md +++ b/details.md @@ -74,9 +74,9 @@ $ git checkout main You might not need all the things that cli-config installs. To see the list of tools available pass the `--help` switch. You can pass the list of tools to install with the `-t` or `--tools` switch, like so ```bash -$ ./cli-config install --tools antigen,nvm,ohmyposh +$ ./cli-config install --tools zimfw,asdf,ohmyposh ``` 3. Run the setup again -After thinking about it, I've decided that cli-config should retain the older installation even if you run `./cli-config` multiple times. So, incase you want to reinstall any tool, you can delete that folder or the entire `current` folder before running setup again. (Example: If you want to reinstall nvm, delete the `current/nvm` folder and run `cli-config` again) +After thinking about it, I've decided that cli-config should retain the older installation even if you run `./cli-config` multiple times. So, incase you want to reinstall any tool, you can delete that folder or the entire `current` folder before running setup again. (Example: If you want to reinstall asdf, delete the `current/asdf` folder and run `cli-config` again) diff --git a/readme.md b/readme.md old mode 100755 new mode 100644 index 861e902..b73dcfe --- a/readme.md +++ b/readme.md @@ -76,10 +76,7 @@ Once the setup is done, your `~/.zshrc` will be symlinked to the [default profil - [antigen](https://github.com/zsh-users/antigen) for more plugins 😉 ### Programming Support -- [nvm](https://github.com/nvm-sh/nvm) for managing multiple node versions -- [pyenv](https://github.com/pyenv/pyenv) for multiple python versions -- [dotnet](https://github.com/dotnet/core) -- [tfenv](https://github.com/tfutils/tfenv) manage multiple terraform versions +- [asdf](https://github.com/asdf-vm/asdf) single version manager for every runtime (node, python, go, dotnet, terraform, ...) via plugins ### Helpers and Goodies - [direnv](https://github.com/direnv/direnv) @@ -94,13 +91,12 @@ Once the setup is done, your `~/.zshrc` will be symlinked to the [default profil ## What's new? 🎉 -- Manage multiple terraform version with [tfenv](https://github.com/tfutils/tfenv). +- Runtime versions are managed solely by [asdf](https://github.com/asdf-vm/asdf) - the nvm, pyenv, gvm, tfenv and dotnet installers have been removed. - Theming & Prompt customization support with [oh-my-posh](https://github.com/JanDeDobbeleer/oh-my-posh). - Fresh new installation experience, powered by [Bash oo Framework](https://github.com/niieani/bash-oo-framework). - Switch antigen themes with a single env variable `CLI_CONFIG_THEME` - Extra tools available for Linux as well! Check out the [package list](extras/apt-list.txt). - New extras package - [tmux](https://github.com/tmux/tmux/wiki) - Setup apps and cool goodies on macOS with brew. Checkout the [extras](extras/setup.sh) script. -- Support for .nvmrc - set node version for a particular directory! \-S diff --git a/src/defs/configure.zsh b/src/defs/configure.zsh index 7114275..fa57f4c 100755 --- a/src/defs/configure.zsh +++ b/src/defs/configure.zsh @@ -12,7 +12,7 @@ configure() { # load cli-config env variables . ${CLI_CONFIG_ROOT}/src/scripts/env.zsh - programs=('asdf' 'zimfw' 'ohmyzsh' 'ohmyposh' 'nvm' 'pyenv' 'dotnet' 'tfenv' 'gvm' 'zsh-plugins') + programs=('asdf' 'zimfw' 'ohmyzsh' 'ohmyposh' 'zsh-plugins') for item in ${programs[@]}; do Log "Updating configuration for cli-config/${item}" if [ -d "${CLI_CONFIG_ROOT}/current/${item}" ]; then diff --git a/src/extras/nvmrc-support.zsh b/src/extras/nvmrc-support.zsh deleted file mode 100755 index f884d4a..0000000 --- a/src/extras/nvmrc-support.zsh +++ /dev/null @@ -1,21 +0,0 @@ -# .nvmrc support -autoload -U add-zsh-hook -load-nvmrc() { - local node_version="$(nvm version)" - local nvmrc_path="$(nvm_find_nvmrc)" - - if [ -n "$nvmrc_path" ]; then - local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") - - if [ "$nvmrc_node_version" = "N/A" ]; then - nvm install - elif [ "$nvmrc_node_version" != "$node_version" ]; then - nvm use - fi - elif [ "$node_version" != "$(nvm version default)" ]; then - echo "Reverting to nvm default version" - nvm use default - fi -} -add-zsh-hook chpwd load-nvmrc -load-nvmrc diff --git a/src/installers/dotnet.configure.zsh b/src/installers/dotnet.configure.zsh deleted file mode 100755 index b49add6..0000000 --- a/src/installers/dotnet.configure.zsh +++ /dev/null @@ -1,6 +0,0 @@ -TOOL=dotnet -CONF=$CLI_CONFIG_CONF_LOCATION/$TOOL.conf.sh - -echo -n >$CONF -printf 'export DOTNET_ROOT="$CLI_CONFIG_ROOT/current/dotnet"\n' >>$CONF -printf 'export PATH="$CLI_CONFIG_ROOT/current/dotnet:$PATH"\n' >>$CONF diff --git a/src/installers/dotnet.install.zsh b/src/installers/dotnet.install.zsh deleted file mode 100755 index 938d2e3..0000000 --- a/src/installers/dotnet.install.zsh +++ /dev/null @@ -1,11 +0,0 @@ -if [ -d "$CLI_CONFIG_ROOT/current/dotnet" ]; then - Log 'Seems cli-config/dotnet is already installed!' -else - Log "Installing dotnet" - - mkdir $CLI_CONFIG_ROOT/current/dotnet - - dotnetInstallerLocation=$CLI_CONFIG_TOOLS_LOCATION/dotnet-install.sh - wget -O $dotnetInstallerLocation https://dot.net/v1/dotnet-install.sh - bash $dotnetInstallerLocation --install-dir $CLI_CONFIG_ROOT/current/dotnet --channel STS -fi diff --git a/src/installers/gvm.configure.zsh b/src/installers/gvm.configure.zsh deleted file mode 100755 index 7421a1b..0000000 --- a/src/installers/gvm.configure.zsh +++ /dev/null @@ -1,10 +0,0 @@ -export GOROOT="${CLI_CONFIG_ROOT}/current/gvm" -TOOL=gvm -CONF=$CLI_CONFIG_CONF_LOCATION/$TOOL.conf.sh -DEFAULT_GO_VERSION=go1.17.7 - -echo -n >$CONF -printf 'export GVM_DIR="$CLI_CONFIG_ROOT/current/gvm"\n' >>$CONF -printf "# add gvm to path\n" >>$CONF -printf 'export PATH="$GVM_DIR:$PATH"\n' >>$CONF -printf 'lazyload gvm -- "source $GVM_DIR/scripts/gvm"' >>$CONF diff --git a/src/installers/gvm.install.zsh b/src/installers/gvm.install.zsh deleted file mode 100755 index c5a2608..0000000 --- a/src/installers/gvm.install.zsh +++ /dev/null @@ -1,32 +0,0 @@ -export GOROOT="${CLI_CONFIG_ROOT}/current/gvm" -TOOL=gvm -CONF=$CLI_CONFIG_CONF_LOCATION/$TOOL.conf.sh -DEFAULT_GO_VERSION=go1.17.7 - -if [ -d "$CLI_CONFIG_ROOT/current/$TOOL" ]; then - Log 'Seems cli-config/gvm is already installed!' -else - Log "Installing gvm" - - curl -sSL https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer | zsh -s -- master "$CLI_CONFIG_ROOT/current" - - currentOs=$(uname -s) - if [ $currentOs = "Linux" ]; then - # TODO: check if we are specifically on Ubuntu - Log "Setting up dependencies for gvm" - cmd="$CCOPT_DEBIAN_FRONTEND $CCOPT_NO_SUDO apt install --yes --no-install-recommends curl git mercurial make binutils bison gcc build-essential" - Log "$cmd" - eval $cmd - elif [ $currentOs = "Darwin" ]; then - cmd="brew install mercurial" - Log "$cmd" - eval $cmd - fi - - Log "Installing $DEFAULT_GO_VERSION with gvm" - export GVM_DIR="$CLI_CONFIG_ROOT/current/gvm" - . $GOROOT/scripts/gvm - gvm install $DEFAULT_GO_VERSION -B - Log "Setting up $DEFAULT_GO_VERSION to be used globally" - gvm use $DEFAULT_GO_VERSION --default -fi diff --git a/src/installers/nvm.configure.zsh b/src/installers/nvm.configure.zsh deleted file mode 100755 index acc721d..0000000 --- a/src/installers/nvm.configure.zsh +++ /dev/null @@ -1,9 +0,0 @@ -TOOL=nvm -CONF=$CLI_CONFIG_CONF_LOCATION/$TOOL.conf.sh - -echo -n >$CONF -printf 'export NVM_DIR="$CLI_CONFIG_ROOT/current/nvm"\n' >>$CONF -printf "# add nvm to path\n" >>$CONF -printf 'export PATH="$NVM_DIR:$PATH"\n' >>$CONF -# printf 'lazyload nvm node npm -- "source $NVM_DIR/nvm.sh"' >>$CONF -# turn off lazyload until I figure out how to let it work with AI agents diff --git a/src/installers/nvm.install.zsh b/src/installers/nvm.install.zsh deleted file mode 100755 index e5cc258..0000000 --- a/src/installers/nvm.install.zsh +++ /dev/null @@ -1,16 +0,0 @@ -TOOL=nvm -CONF=$CLI_CONFIG_CONF_LOCATION/$TOOL.conf.sh - -if [ -d "$CLI_CONFIG_ROOT/current/nvm" ]; then - Log 'Seems cli-config/nvm is already installed!' -else - Log "Installing nvm" - Log "Installing node.js with nvm" - - NVM_DIR=$CLI_CONFIG_ROOT/current/nvm - mkdir $NVM_DIR - wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | PROFILE=/dev/null NVM_DIR=$CLI_CONFIG_ROOT/current/nvm bash - - . $NVM_DIR/nvm.sh - nvm install --lts -fi diff --git a/src/installers/pyenv.configure.zsh b/src/installers/pyenv.configure.zsh deleted file mode 100755 index 69d12d7..0000000 --- a/src/installers/pyenv.configure.zsh +++ /dev/null @@ -1,8 +0,0 @@ -TOOL=pyenv -CONF=$CLI_CONFIG_CONF_LOCATION/$TOOL.conf.sh - -echo -n >$CONF -printf "export PYENV_ROOT="$CLI_CONFIG_ROOT/current/pyenv"\n" >>$CONF -printf "export PATH="\$PYENV_ROOT/bin:\$PYENV_ROOT/shims:\$PATH"\n" >>$CONF -printf "eval \"\$(pyenv init -)\"\n" >>$CONF -printf "eval \"\$(pyenv virtualenv-init -)\"\n" >>$CONF diff --git a/src/installers/pyenv.install.zsh b/src/installers/pyenv.install.zsh deleted file mode 100755 index 5004522..0000000 --- a/src/installers/pyenv.install.zsh +++ /dev/null @@ -1,31 +0,0 @@ -DEFAULT_PYTHON_VERSION=3.10.2 - -if [ -d "$CLI_CONFIG_ROOT/current/pyenv" ]; then - Log 'Seems cli-config/pyenv is already installed!' -else - - Log "Installing pyenv" - - CLI_CONFIG_PYENV_ROOT=$CLI_CONFIG_ROOT/current/pyenv - - git clone --depth=1 https://github.com/pyenv/pyenv.git $CLI_CONFIG_PYENV_ROOT - - currentOs=$(uname -s) - if [ $currentOs = "Linux" ]; then - # TODO: check if we are specifically on Ubuntu - Log "Setting up dependencies for pyenv" - cmd="$CCOPT_DEBIAN_FRONTEND $CCOPT_NO_SUDO apt install --yes --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev" - Log "$cmd" - eval $cmd - elif [ $currentOs = "Darwin" ]; then - Log 'No macOS specific customization need for pyenv' - fi - - Log "Installing pyenv virtualenv" - git clone https://github.com/pyenv/pyenv-virtualenv.git $CLI_CONFIG_ROOT/current/pyenv/plugins/pyenv-virtualenv - - Log "Installing python-$DEFAULT_PYTHON_VERSION with pyenv" - $CLI_CONFIG_PYENV_ROOT/bin/pyenv install $DEFAULT_PYTHON_VERSION - Log "Installing python-$DEFAULT_PYTHON_VERSION to be used globally" - $CLI_CONFIG_PYENV_ROOT/bin/pyenv global $DEFAULT_PYTHON_VERSION -fi diff --git a/src/installers/tfenv.configure.zsh b/src/installers/tfenv.configure.zsh deleted file mode 100755 index f798e4a..0000000 --- a/src/installers/tfenv.configure.zsh +++ /dev/null @@ -1,6 +0,0 @@ -TOOL=tfenv -CONF=$CLI_CONFIG_CONF_LOCATION/$TOOL.conf.sh - -echo -n >$CONF -printf "export TFENV_ROOT="$CLI_CONFIG_ROOT/current/tfenv"\n" >>$CONF -printf "export PATH="\$TFENV_ROOT/bin:\$PATH"\n" >>$CONF diff --git a/src/installers/tfenv.install.zsh b/src/installers/tfenv.install.zsh deleted file mode 100755 index bf308b6..0000000 --- a/src/installers/tfenv.install.zsh +++ /dev/null @@ -1,10 +0,0 @@ -if [ -d "$CLI_CONFIG_ROOT/current/tfenv" ]; then - Log 'Seems cli-config/tfenv is already installed!' -else - - Log "Installing tfenv" - - CLI_CONFIG_TFENV_ROOT=$CLI_CONFIG_ROOT/current/tfenv - - git clone --depth=1 https://github.com/tfutils/tfenv.git $CLI_CONFIG_TFENV_ROOT -fi diff --git a/src/utils/read-options.zsh b/src/utils/read-options.zsh index df5f357..1318372 100755 --- a/src/utils/read-options.zsh +++ b/src/utils/read-options.zsh @@ -5,7 +5,7 @@ read_options() { CCOPT_PROFILE=default CCOPT_NO_SUDO='sudo' CCOPT_DEBIAN_FRONTEND='' - CCOPT_TOOLS=('zimfw' 'ohmyposh' 'asdf' 'dotnet') + CCOPT_TOOLS=('zimfw' 'ohmyposh' 'asdf') # READ OPTIONS # Todo: Move to separate file diff --git a/src/utils/tool-guards.zsh b/src/utils/tool-guards.zsh index 364006e..29c0e63 100644 --- a/src/utils/tool-guards.zsh +++ b/src/utils/tool-guards.zsh @@ -2,8 +2,6 @@ PLUGIN_MANAGERS=('zimfw' 'antigen') PLUGIN_MANAGER_DEFAULT='zimfw' -DEPRECATED_TOOLS=('tfenv' 'pyenv' 'nvm' 'gvm') -DEPRECATED_TOOLS_REPLACEMENT='asdf' validate_tools() { local tools=("$@") @@ -11,13 +9,6 @@ validate_tools() { local errors=() for tool in "${tools[@]}"; do - # deprecation check - for deprecated in "${DEPRECATED_TOOLS[@]}"; do - if [[ "$tool" == "$deprecated" ]]; then - echo "[cli-config] Warning: '$tool' is deprecated — use '$DEPRECATED_TOOLS_REPLACEMENT' instead." - fi - done - # count how many plugin managers were requested for pm in "${PLUGIN_MANAGERS[@]}"; do if [[ "$tool" == "$pm" ]]; then