dl.emersa.it/scripts/install.sh
0d0 5ff4dc73de
All checks were successful
Bump deps (only minor versions) / ci (push) Successful in 37s
Update install script to accept proxy
2025-02-26 16:18:52 +01:00

33 lines
722 B
Bash
Executable file

#!/usr/bin/bash
### This is a script for installing the latest release
### of `scaricatore`.
PROJECT_ROOT=$1
PROXY=$2
if [ -z ${PROJECT_ROOT+x} ]; then
echo "ERROR: No PROJECT_ROOT set (first argument to ${0})"
exit 1
fi
if [ -z ${PROXY+x} ]; then
echo "INFO: no proxy given"
fi
mkdir -p "${PROJECT_ROOT}"
cd "${PROJECT_ROOT}" || exit 1
read -p "We're about to run rm -rf ${PROJECT_ROOT}/*. Are you sure?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
rm -rf ./*
fi
wget https://git.pweapon.org/odo/dl.emersa.it/releases/download/latest/build.tar.gz
tar -xvf build.tar.gz -C .
rm build.tar.gz
npm ci
npm run download-yt-dlp
echo "YTDLP_PATH=$(readlink -f yt-dlp)" >>.env
echo "HTTPS_PROXY=${PROXY}" >>.env