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

Commit 6858db5

Browse files
committed
fix for root user and non-root user
1 parent a63aeae commit 6858db5

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

.github/workflows/pre-commit-job.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,20 @@ function abort() {
3232
}
3333

3434
function install_miniconda() {
35-
#apt update
36-
#apt install -y wget git
35+
platform=$(get_platform)
36+
echo $platform
37+
if [[ $platform =~ "Linux" ]]; then
38+
if [`id -u` -eq 0 ]; then
39+
echo "root user"
40+
apt update
41+
apt install -y wget unzip zip git
42+
else
43+
echo "not root user"
44+
sudo apt update
45+
sudo apt install -y wget unzip zip git
46+
fi
47+
fi
48+
3749
#cmd="conda"
3850
#is_conda_existed=`is_cmd_existed ${cmd}`
3951
#echo $is_conda_existed

models/download.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ function prepare_env() {
1717
platform=$(get_platform)
1818
echo $platform
1919
if [[ $platform =~ "Linux" ]]; then
20-
sudo apt update
21-
sudo apt install -y wget unzip zip
20+
if [`id -u` -eq 0 ]; then
21+
echo "root user"
22+
apt update
23+
apt install -y wget unzip zip
24+
else
25+
echo "not root user"
26+
sudo apt update
27+
sudo apt install -y wget unzip zip
28+
fi
2229
fi
2330
}
2431

0 commit comments

Comments
 (0)