Skip to content
This repository has been archived by the owner on Nov 25, 2023. It is now read-only.

Commit

Permalink
fix for root user and non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
ysh329 committed Jun 27, 2020
1 parent a63aeae commit 6858db5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/pre-commit-job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions models/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 6858db5

Please sign in to comment.