diff --git a/README.md b/README.md index 2f94306..80d5952 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,14 @@ curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-apt.sh | bash # docker-ce curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-docker.sh | bash +# npm +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-npm.sh | bash +# pip +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-pip.sh | bash +# git +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-git.sh | bash + + # 初始化全部 curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-all.sh | bash ``` diff --git a/init-all.sh b/init-all.sh index 57e6756..3a0ea27 100644 --- a/init-all.sh +++ b/init-all.sh @@ -3,4 +3,10 @@ # apt + ntp curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-apt.sh | bash # docker-ce -curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-docker.sh | bash \ No newline at end of file +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-docker.sh | bash +# npm +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-npm.sh | bash +# pip +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-pip.sh | bash +# git +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-git.sh | bash \ No newline at end of file diff --git a/init-git.sh b/init-git.sh new file mode 100644 index 0000000..cfe833e --- /dev/null +++ b/init-git.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# 检查 git 是否安装 +if command -v pip &> /dev/null; then + echo "git 已安装,正在配置镜像源..." + git config --global url."https://git-proxy.hk.martin98.com/".insteadOf "https://" + echo "镜像源配置完成。" +fi \ No newline at end of file diff --git a/init-npm.sh b/init-npm.sh new file mode 100644 index 0000000..f023d23 --- /dev/null +++ b/init-npm.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# 检查 npm 是否安装 +if command -v npm &> /dev/null; then + echo "npm 已安装,正在配置镜像源..." + npm config set registry https://mirrors.martin98.com/repository/npm-group/ + echo "镜像源配置完成。" +fi \ No newline at end of file diff --git a/init-pip.sh b/init-pip.sh new file mode 100644 index 0000000..19e96ee --- /dev/null +++ b/init-pip.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# 检查 pip 是否安装 +if command -v pip &> /dev/null; then + echo "pip 已安装,正在配置镜像源..." + pip config set global.index-url https://mirrors.martin98.com/repository/pypi-group/simple + echo "镜像源配置完成。" +fi \ No newline at end of file