diff --git a/README.en.md b/README.en.md index 47dc2b999dc61740330dcd02566c80396213d17b..b0ed251de01c0be2ea1a77ef25a6db982dc78610 100644 --- a/README.en.md +++ b/README.en.md @@ -26,6 +26,14 @@ Before installing, you should add openeuler-everything to your yum repo: ```bash sh install.sh ``` + +This script will clone node-sass from gitee by default, user can change the url of node-sass package by themselves: +```bash +sh install.sh [git_url] +# for example, you can use github url to clone code +# sh install.sh https://github.com/sass/node-sass.git +``` + > If shell end with error, please follow the install manual diff --git a/README.md b/README.md index 10c897a74350b8f36583c13132d11455de80feae..7f0c60eb5754fc2ef317291f1b684fb61347f14e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,14 @@ A-Tune-UI是作用于A-Tune的可视化web界面,需要搭配[A-Tune](https:// ```bash sh install.sh ``` -如果安装失败,请参考手动安装。 + +自动化脚本默认从gitee拉取node-sass依赖仓的代码,用户可以自行更换拉取地址(如替换为github仓地址),具体运行方法如下: +```bash +sh install.sh [git_url] +# 例:sh install.sh https://github.com/sass/node-sass.git +``` + +> 如果安装失败,请参考手动安装。 #### 2-2、手动安装 diff --git a/install.sh b/install.sh index a09e774218c703df4e590d7a9c51912ff8b83779..1b94f8fc91c8d8ba1d797d0daf91543e93136fbc 100644 --- a/install.sh +++ b/install.sh @@ -40,6 +40,7 @@ build_finished() rm -f $LOG_FILE } +url=$1 yum install -y make nodejs npm patch gcc-c++ >& $LOG_FILE build_err $? "yum install" @@ -50,7 +51,10 @@ build_err $? "install dependency" cd .. rm -rf node-sass -git clone -b v5 --recursive https://github.com/sass/node-sass.git >& $LOG_FILE +if [ -z "$url" ]; then + url=https://gitee.com/mirrors/node-sass.git +fi +git clone -b v5 --recursive $url >& $LOG_FILE build_err $? "clone repo" cd node-sass