From 303e59ec023a577f38abb41455741177961d20fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A5=E5=87=A1?= Date: Fri, 3 Apr 2026 10:03:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-user.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 install-user.sh diff --git a/install-user.sh b/install-user.sh new file mode 100644 index 0000000..39e95af --- /dev/null +++ b/install-user.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# --------------------------------------------------------------- +# File : install.sh +# Authors : ccmywish +# aifuxi +# Created on : <2021-01-06> +# Last modified : <2024-06-10> +# +# install: +# +# This file installs nvm and change Node.JS source on your linux +# +# ---------- +# Changelog: +# +# Note that, the '@user' represents the user id of Gitee +# +# ~> v0.1.0 +# <2023-07-20> Gitee追踪的仓库被删除,暂时启用我们的备用仓库 by @ccmywish +# <2023-05-09> Check Git first and add CI on Gitee by @ccmywish +# <2023-05-01> Update nvm repo source by @ccmywish +# <2022-11-14> Update Node.JS mirror source by @aifuxi +# <2021-01-06> Create file by @ccmywish +# --------------------------------------------------------------- + +# Exit on error +set -e + +if ! [ $(command -v "git") ]; then + echo "=> 请您首先安装Git" + exit 127 +fi + +export NVM_DIR="$HOME/.nvm" && ( + echo "=> Git clone nvm" + git clone https://gitee.com/RubyMetric/nvm-official "$NVM_DIR" # 备用仓库 + # git clone https://gitee.com/mirrors_nvm-sh/nvm "$NVM_DIR" # Gitee提供的追踪上游仓库 + cd "$NVM_DIR" + git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` +) && \. "$NVM_DIR/nvm.sh" + + +echo "=> 添加nvm环境变量(Bash,Zsh)" +echo -e "\n# nvm config" >> ~/.bashrc +echo -e "\n# nvm config" >> ~/.zshrc + +echo "export NVM_DIR=\"\$HOME/.nvm\"" >> ~/.bashrc +echo "export NVM_DIR=\"\$HOME/.nvm\"" >> ~/.zshrc +echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" # This loads nvm" >> ~/.bashrc +echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" # This loads nvm" >> ~/.zshrc + + +echo "=> 使用淘宝镜像" +echo "export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node" >> ~/.bashrc +echo "export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node" >> ~/.zshrc + +echo "=> 安装nvm-update,升级更新请使用该命令" +curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/nvm-update.sh -o nvm-update.sh +chmod +x ./nvm-update.sh + +if ! [ -v NVM_CN_IN_CI ];then + sudo mv ./nvm-update.sh /usr/local/bin/nvm-update +fi + +echo "=> 安装完成! 请重启终端生效" +echo "=> 推荐您使用 https://gitee.com/RubyMetric/chsrc 全平台多语言/OS/软件自动换源" +echo "=> chsrc set npm" +echo -- Gitee From 6382c9213c8c48be98e8ce0344d0c631e78d8209 Mon Sep 17 00:00:00 2001 From: totongf Date: Fri, 3 Apr 2026 02:08:45 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Revert=20"=E5=A2=9E=E5=8A=A0=E6=99=AE?= =?UTF-8?q?=E9=80=9A=E8=84=9A=E6=9C=AC"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 303e59ec023a577f38abb41455741177961d20fa. --- install-user.sh | 68 ------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 install-user.sh diff --git a/install-user.sh b/install-user.sh deleted file mode 100644 index 39e95af..0000000 --- a/install-user.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -# --------------------------------------------------------------- -# File : install.sh -# Authors : ccmywish -# aifuxi -# Created on : <2021-01-06> -# Last modified : <2024-06-10> -# -# install: -# -# This file installs nvm and change Node.JS source on your linux -# -# ---------- -# Changelog: -# -# Note that, the '@user' represents the user id of Gitee -# -# ~> v0.1.0 -# <2023-07-20> Gitee追踪的仓库被删除,暂时启用我们的备用仓库 by @ccmywish -# <2023-05-09> Check Git first and add CI on Gitee by @ccmywish -# <2023-05-01> Update nvm repo source by @ccmywish -# <2022-11-14> Update Node.JS mirror source by @aifuxi -# <2021-01-06> Create file by @ccmywish -# --------------------------------------------------------------- - -# Exit on error -set -e - -if ! [ $(command -v "git") ]; then - echo "=> 请您首先安装Git" - exit 127 -fi - -export NVM_DIR="$HOME/.nvm" && ( - echo "=> Git clone nvm" - git clone https://gitee.com/RubyMetric/nvm-official "$NVM_DIR" # 备用仓库 - # git clone https://gitee.com/mirrors_nvm-sh/nvm "$NVM_DIR" # Gitee提供的追踪上游仓库 - cd "$NVM_DIR" - git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` -) && \. "$NVM_DIR/nvm.sh" - - -echo "=> 添加nvm环境变量(Bash,Zsh)" -echo -e "\n# nvm config" >> ~/.bashrc -echo -e "\n# nvm config" >> ~/.zshrc - -echo "export NVM_DIR=\"\$HOME/.nvm\"" >> ~/.bashrc -echo "export NVM_DIR=\"\$HOME/.nvm\"" >> ~/.zshrc -echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" # This loads nvm" >> ~/.bashrc -echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" # This loads nvm" >> ~/.zshrc - - -echo "=> 使用淘宝镜像" -echo "export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node" >> ~/.bashrc -echo "export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node" >> ~/.zshrc - -echo "=> 安装nvm-update,升级更新请使用该命令" -curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/nvm-update.sh -o nvm-update.sh -chmod +x ./nvm-update.sh - -if ! [ -v NVM_CN_IN_CI ];then - sudo mv ./nvm-update.sh /usr/local/bin/nvm-update -fi - -echo "=> 安装完成! 请重启终端生效" -echo "=> 推荐您使用 https://gitee.com/RubyMetric/chsrc 全平台多语言/OS/软件自动换源" -echo "=> chsrc set npm" -echo -- Gitee