43 lines
967 B
Bash
Executable File
43 lines
967 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
set -e
|
|
|
|
PROG_VER=$(echo $0 | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+([ab]|(rc[-]*[0-9]*))")
|
|
|
|
echo $PROG_VER
|
|
|
|
function cmd_exists() {
|
|
if ! command -v $1 &> /dev/null
|
|
then
|
|
return 1
|
|
else
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
if cmd_exists "pacman"; then
|
|
if cmd_exists "yay"; then
|
|
yay -Sy --needed ffmpeg yt-dlp spotdl curl
|
|
else
|
|
sudo pacman -Sy --needed ffmpeg yt-dlp python python-pip python-pipx curl
|
|
pipx install spotdl
|
|
fi
|
|
fi
|
|
|
|
if cmd_exists "apt"; then
|
|
sudo apt-get update
|
|
sudo apt-get install python3 python3-pip ffmpeg curl
|
|
|
|
# updates all python packages, uncomment if you get errors for packages
|
|
# pip3 freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
|
|
python3 -m pip install --upgrade pip
|
|
python3 -m pip install spotdl
|
|
python3 -m pip install yt-dlp
|
|
fi
|
|
|
|
curl "https://git.mcorangehq.xyz/XOR64/music/releases/download/${PROG_VER}/mcmg_linux_x86_64" -o mcmg
|
|
|
|
|
|
|
|
|