Update install script

This commit is contained in:
crschnick 2023-09-13 08:06:00 +00:00
parent d90db71ee7
commit de0a235d91

View file

@ -99,19 +99,19 @@ uninstall() {
local uname_str="$(uname -s)" local uname_str="$(uname -s)"
case "$uname_str" in case "$uname_str" in
Linux) Linux)
if [ -d "/opt/xpipe" ]; then if [ -d "/opt/$kebap_product_name" ]; then
info "Uninstalling previous version" info "Uninstalling previous version"
if [ -f "/etc/debian_version" ]; then if [ -f "/etc/debian_version" ]; then
DEBIAN_FRONTEND=noninteractive sudo apt-get remove -qy xpipe DEBIAN_FRONTEND=noninteractive sudo apt-get remove -qy "$kebap_product_name"
else else
sudo rpm -e xpipe sudo rpm -e "$kebap_product_name"
fi fi
fi fi
;; ;;
Darwin) Darwin)
if [ -d "/Applications/XPipe.app" ]; then if [ -d "/Applications/$product_name.app" ]; then
info "Uninstalling previous version" info "Uninstalling previous version"
sudo /Applications/XPipe.app/Contents/Resources/scripts/uninstall.sh sudo "/Applications/$product_name.app/Contents/Resources/scripts/uninstall.sh"
fi fi
;; ;;
*) *)
@ -188,16 +188,22 @@ return 0 2>/dev/null
arch=$(check_architecture) arch=$(check_architecture)
exit_status="$?" exit_status="$?"
if [ "$exit_status" != 0 ]; then if [ "$exit_status" != 0 ]; then
error "Sorry! XPipe currently does not support your processor architecture." error "Sorry! $product_name currently does not support your processor architecture."
exit "$exit_status" exit "$exit_status"
fi fi
repo="https://github.com/xpipe-io/xpipe" repo="https://github.com/xpipe-io/xpipe"
aur="https://aur.archlinux.org/xpipe.git"
product_name="XPipe"
kebap_product_name="xpipe"
version= version=
while getopts 'sv:' OPTION; do while getopts 'sv:' OPTION; do
case "$OPTION" in case "$OPTION" in
s) s)
repo="https://github.com/xpipe-io/xpipe-ptb" repo="https://github.com/xpipe-io/xpipe-ptb"
aur="https://aur.archlinux.org/xpipe-ptb.git"
product_name="XPipe PTB"
kebap_product_name="xpipe-ptb"
;; ;;
v) v)
@ -212,12 +218,12 @@ while getopts 'sv:' OPTION; do
done done
if ! [ -x "$(command -v apt)" ] && ! [ -x "$(command -v rpm)" ] && [ -x "$(command -v pacman)" ]; then if ! [ -x "$(command -v apt)" ] && ! [ -x "$(command -v rpm)" ] && [ -x "$(command -v pacman)" ]; then
info "Installing from AUR at https://aur.archlinux.org/xpipe.git" info "Installing from AUR at $aur"
rm -rf "/tmp/xpipe_aur" || true rm -rf "/tmp/xpipe_aur" || true
if [[ -z "$version" ]] ; then if [[ -z "$version" ]] ; then
git clone "https://aur.archlinux.org/xpipe.git" /tmp/xpipe_aur git clone "$aur" /tmp/xpipe_aur
else else
git clone --branch "$version" "https://aur.archlinux.org/xpipe.git" /tmp/xpipe_aur git clone --branch "$version" "$aur" /tmp/xpipe_aur
fi fi
cd "/tmp/xpipe_aur" cd "/tmp/xpipe_aur"
makepkg -si makepkg -si
@ -226,7 +232,7 @@ if ! [ -x "$(command -v apt)" ] && ! [ -x "$(command -v rpm)" ] && [ -x "$(comma
fi fi
if ! [ -x "$(command -v apt)" ] && ! [ -x "$(command -v rpm)" ] && ! [ -x "$(command -v pacman)" ]; then if ! [ -x "$(command -v apt)" ] && ! [ -x "$(command -v rpm)" ] && ! [ -x "$(command -v pacman)" ]; then
info "Installation is not supported on this system (no apt, rpm, pacman). Can you try a portable version of XPipe?" info "Installation is not supported on this system (no apt, rpm, pacman). Can you try a portable version of $product_name?"
info "https://github.com/xpipe-io/xpipe#portable" info "https://github.com/xpipe-io/xpipe#portable"
exit 1 exit 1
fi fi
@ -237,7 +243,7 @@ download_archive="$(
)" )"
exit_status="$?" exit_status="$?"
if [ "$exit_status" != 0 ]; then if [ "$exit_status" != 0 ]; then
error "Could not download XPipe release." error "Could not download $product_name release."
exit "$exit_status" exit "$exit_status"
fi fi
@ -251,13 +257,6 @@ if [ "$exit_status" != 0 ]; then
fi fi
echo "" echo ""
printf "XPipe was successfully installed. You should be able to find XPipe in your desktop environment now. The " echo "$product_name was successfully installed. You should be able to find $product_name in your desktop environment now."
bold "xpipe"
printf " cli executable was also added to your path. You can ether use "
bold "man xpipe"
printf " or "
bold "xpipe --help"
printf " for help.\n"
echo ""
launch launch