From ccbb409bf4763d27a24beef5286a0643dc0467ae Mon Sep 17 00:00:00 2001 From: gaoruoshu Date: Tue, 2 Mar 2021 15:24:21 +0800 Subject: [PATCH] update install.sh: providing clone code from gitee option --- README.en.md | 8 ++++++++ README.md | 9 ++++++++- install.sh | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index 47dc2b9..b0ed251 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 10c897a..7f0c60e 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 a09e774..1b94f8f 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 -- Gitee