Skip to content

Commit

Permalink
Optional sudo so that github actions will work
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcgary committed Oct 8, 2024
1 parent 5206f45 commit e32c71c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/installDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -a | tr '[:upper:]' '[:lower:]')

command_exists() {
command -v "$@" > /dev/null 2>&1
}

apt_update_and_install() {
if command_exists sudo; then
sudo apt-get update
sudo apt-get install "$@"
else
apt-get update
apt-get install "$@"
fi
}

if [[ "$OS" == "linux" ]]; then
apt-get update
apt-get install -y \
apt_update_and_install -y \
make \
curl \
git \
Expand Down

0 comments on commit e32c71c

Please sign in to comment.