add some automation to dependency installation

This commit is contained in:
Logan Joy-Koer
2025-12-10 21:29:18 -08:00
parent 1b74923c83
commit fa3629f788
+26 -6
View File
@@ -1,18 +1,36 @@
#!/bin/env bash #!/bin/env bash
PACKAGEMANAGER=
echo "Detecting your package manager and updating package lists..."
if (command -v pacman >/dev/null); then
PACKAGEMANAGER="pacman -S"
sudo pacman -Sy
elif (command -v apt >/dev/null); then
PACKAGEMANAGER="apt install"
sudo apt update
else
echo "no supported package manager installed. you're on your own."
if (command -v git >/dev/null); then echo -n ""; else if (command -v git >/dev/null); then echo -n ""; else
if [ null$PACKAGEMANAGER = null ]; then
echo "Git is not installed. Please use your system" echo "Git is not installed. Please use your system"
echo " package manager to install git." echo " package manager to install git."
echo " e.g. \`sudo apt install git\` on ubuntu"
echo " or \`sudo pacman -S git\` on arch."
exit 1 exit 1
else
$PACKAGEMANAGER git
fi
fi fi
if (command -v cargo >/dev/null); then echo -n ""; else if (command -v cargo >/dev/null); then echo -n ""; else
if [ null$PACKAGEMANAGER = null ]; then
echo "Cargo is not installed. Please use your system" echo "Cargo is not installed. Please use your system"
echo " package manager to install cargo." echo " package manager to install cargo."
echo " e.g. \`sudo apt install cargo\` on ubuntu"
echo " or \`sudo pacman -S cargo\` on arch."
exit 1 exit 1
else
$PACKAGEMANAGER cargo
fi
fi fi
mkdir deps mkdir deps
@@ -49,8 +67,10 @@ curl -o "./python-2.1.exe" "https://www.python.org/ftp/python/2.1.3/Python-2.1.3
echo "download complete." echo "download complete."
if (command -v wine >/dev/null) then echo -n ""; else if (command -v wine >/dev/null) then echo -n ""; else
if [ null$PACKAGEMANAGER = null ]; then
echo "Wine is not installed. Please use your system" echo "Wine is not installed. Please use your system"
echo " package manager to install wine." echo " package manager to install wine."
echo " e.g. \`sudo apt install wine\` on ubuntu" else
echo " or \`sudo pacman -S wine\` on arch." $PACKAGEMANAGER wine
fi
fi fi