version-manager(vmr)多sdk版本管理

对多个编程sdk进行版本管理

version-manager(vmr)

A general version manager for thousands of SDKs

doc

支持sdk列表

mac部署

1.1download version-manager

➜  .bin ./vmr --help
vmr <Command> <SubCommand> --flags args...

Usage:
  vmr [flags]
  vmr [command]

Command list: 
  add-completions         Add auto-completions for vmr to current shell profile.
  install-self            Installs version manager.  //第一次安装自动配置相关文件
  installed-info          Shows installed SDK information.
  installed-sdks          Shows installed SDKs.
  is-session-mode         Show if current shell is in session mode.
  local                   Shows installed versions for an SDK.
  nested-sessions         Toggle nested sessions.
  search                  Searches available versions.
  set-download-threads    Set default threads number for downloadding.
  set-proxy               Sets proxy for version manager.
  set-reverse-proxy       Sets reverse proxy for version manager.
  show                    Show available SDKs.
  toggle-customed-mirrors Toggle customed mirrors.
  uninstall               Uninstall versions for an SDK.
  uninstall-self          Uninstalls version manager, Only for script.
  use                     Installs and switches to a version for an SDK.  //安装切换sdk版本
  version                 Shows version info of version-manager.

Additional Commands:
  completion              Generate the autocompletion script for the specified shell
  help                    Help about any command

Flags:
  -h, --help   help for vmr

Use "vmr [command] --help" for more information about a command.

1.2init

./vmr install-self

1.3show sdk

vmr show
95a45a06ff3cd917027dbce2fff258f2.png

1.4download sdk

vmr search rust
vmr use [email protected]

189eb4aec6c435b088ea6b4716dc6a90.png

4d9291cb555c0d512276b818802e546c.png

1a29d54919f3590d0158ffcfd51d9a5b.png

1.5版本生效机制

~/.zshrc -> ~/.vmr/vmr.sh -> PATH

# vmr sdk路径配置
➜  ~ tail  ~/.vmr/vmr.sh

if [ -z "${VMR_CD_INIT}" ]; then
        VMR_CD_INIT="vmr_cd_init"
        cd "$(pwd)"
fi
# cd hook end

export PATH=/Users/mvpbang/.vmr/versions/node_versions/node/bin:"${PATH}"
export PATH=/Users/mvpbang/.vmr/versions/miniconda_versions/miniconda/bin:/Users/mvpbang/.vmr/versions/miniconda_versions/miniconda/condabin:"${PATH}"
export PATH=/Users/mvpbang/.vmr/versions/rust_versions/rust/bin:"${PATH}"

# zshrc载入执行
➜  ~ tail ~/.zshrc
. /Users/mvpbang/.vmr/vmr_completions.sh
# VMR Completions
# vm_envs start
if [ -z "$VM_DISABLE" ]; then
    #echo "--- vmr.sh"
    . ~/.vmr/vmr.sh
fi
# vm_envs end

alias svmr="export VM_DISABLE='' && source /Users/mvpbang/.zshrc"