diff --git a/.github/workflows/pre-commit-job.sh b/.github/workflows/pre-commit-job.sh index 4a84866..66b699c 100755 --- a/.github/workflows/pre-commit-job.sh +++ b/.github/workflows/pre-commit-job.sh @@ -32,8 +32,20 @@ function abort() { } function install_miniconda() { - #apt update - #apt install -y wget git + platform=$(get_platform) + echo $platform + if [[ $platform =~ "Linux" ]]; then + if [`id -u` -eq 0 ]; then + echo "root user" + apt update + apt install -y wget unzip zip git + else + echo "not root user" + sudo apt update + sudo apt install -y wget unzip zip git + fi + fi + #cmd="conda" #is_conda_existed=`is_cmd_existed ${cmd}` #echo $is_conda_existed diff --git a/models/download.sh b/models/download.sh index 6dec17a..e2cd3b5 100755 --- a/models/download.sh +++ b/models/download.sh @@ -17,8 +17,15 @@ function prepare_env() { platform=$(get_platform) echo $platform if [[ $platform =~ "Linux" ]]; then - sudo apt update - sudo apt install -y wget unzip zip + if [`id -u` -eq 0 ]; then + echo "root user" + apt update + apt install -y wget unzip zip + else + echo "not root user" + sudo apt update + sudo apt install -y wget unzip zip + fi fi }