From d347d89dfeef54d648ffdea054897617c0016509 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 6 Jun 2026 19:48:22 +0300 Subject: correctly working auto completion for db --- install.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 280be8a..25a1f52 100755 --- a/install.sh +++ b/install.sh @@ -1,13 +1,16 @@ +#!/bin/bash + # This file is a part of RSPlayer # Licensed under the GPL-3.0 License # Copyright (C) 2026 Salmonik @ salmonik@tuta.io # https://codeberg.org/salmonik/RSPlayer -#!/bin/bash set -e -echo "Updating the repo..." -git pull 2>/dev/null +if ping -W 2 -c 1 codeberg.org >&/dev/null; then + echo "Updating the repo..." + git pull 2>/dev/null +fi echo "Building rsplayer in release mode..." cargo build --release @@ -17,8 +20,7 @@ systemctl --user stop rsplayer 2>/dev/null || true rsp stop-daemon 2>/dev/null || true echo "Installing to /usr/bin/rsp..." -sudo cp target/release/rsp /usr/bin/rsp -sudo chmod +x /usr/bin/rsp +sudo install target/release/rsp /usr/bin/rsp echo "" echo "Installing systemd service..." @@ -41,12 +43,16 @@ case "$shell_name" in bash) dest="${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions" mkdir -p "$dest" - /usr/bin/rsp completions bash > "$dest/rsp" + cp completions/rsp.bash "$dest/rsp" echo " → Bash completions: $dest/rsp" ;; zsh) dest="/usr/share/zsh/site-functions/_rsp" - (/usr/bin/rsp completions zsh; echo; cat completions/_rsp) | sudo tee "$dest" > /dev/null + tmpfile=$(mktemp) + /usr/bin/rsp completions zsh > "$tmpfile" + cat completions/_rsp >> "$tmpfile" + sudo cp "$tmpfile" "$dest" + rm -f "$tmpfile" echo " → Zsh completions: $dest" ;; fish) -- cgit v1.2.3