This commit is contained in:
pika 2025-06-25 20:56:56 +02:00
parent f927596b3c
commit d451150b77

14
pika.sh
View file

@ -264,18 +264,20 @@ script-exists() {
check-pika() { check-pika() {
local url tmp bin local url tmp bin
url="https://git.k4li.de/scripts/installs/raw/branch/main/pika.sh" url="https://git.k4li.de/scripts/installs/raw/branch/main/pika.sh"
tmp="$(mktemp)" tmp="$(mktemp -d)"
bin=/usr/local/bin/pika bin=/usr/bin/pika
if ! command-exists pika; then if ! command-exists pika; then
pen "The 'pika' binary was not found on this system." pen "The 'pika' binary was not found on this system."
if confirm "Do you want to install it now?" </dev/tty; then if confirm "Do you want to install it now?" </dev/tty; then
curl -o $tmp -fsSL "$url" cd $tmp || mkdir -p $tmp && cd $tmp
if curl -o pika -fsSL "$url"; then
$_sudo chmod +x ./pika
fi
if [ -f "$tmp" ]; then if [ -f "${tmp}/pika" ]; then
pen bold red "Copying binary now to $bin" pen bold red "Copying binary now to $bin"
$_sudo cp $tmp $bin $_sudo cp "${tmp}/pika" $bin
$_sudo chmod +x $bin
fi fi
fi fi
else else