Skip to content

Commit

Permalink
fix dep check
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio committed Dec 15, 2024
1 parent 42cc271 commit 3c81a8b
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,22 @@ sudonot() {
}

apt_install() {
apt-get install -yqq "$@" || {
sudonot apt-get install -yqq "$@" || {
apt-get update
apt-get install -yqq "$@"
sudonot apt-get install -yqq "$@"
}
}

yq_install() {
mv -f /usr/bin/yq /usr/bin/yq.bak
curl -sSLNZo /usr/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
chmod +x /usr/bin/yq
sudonot mv -f /usr/bin/yq /usr/bin/yq.bak
sudonot curl -sSLNZo /usr/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudonot chmod +x /usr/bin/yq
}

dep_check() {
echo "Verifying dependencies..."
apt_install git curl jq parallel sqlite3 sqlite3-pcre zstd libxml2-utils
yq -V | grep -q mikefarah || yq_install
echo "Dependencies verified!"
}

sudonot dep_check
echo "Verifying dependencies..."
apt_install git curl jq parallel sqlite3 sqlite3-pcre zstd libxml2-utils
yq -V | grep -q mikefarah || yq_install
echo "Dependencies verified!"
# shellcheck disable=SC2046
source $(which env_parallel.bash)
env_parallel --session
Expand Down

0 comments on commit 3c81a8b

Please sign in to comment.