fixed install script for freebsd

This commit is contained in:
veeso
2023-01-30 12:15:56 +01:00
parent d14225c0b9
commit c1b245b4c9

View File

@@ -177,7 +177,7 @@ confirm() {
# Installers # Installers
install_on_bsd() { install_on_bsd() {
try_with_cargo "packages for freeBSD are distribuited no more. Only cargo installations are supported." try_with_cargo "packages for freeBSD are distribuited no more. Only cargo installations are supported." "freebsd"
} }
install_on_arch_linux() { install_on_arch_linux() {
@@ -212,7 +212,7 @@ install_on_linux() {
install_on_arch_linux pikaur install_on_arch_linux pikaur
elif has dpkg; then elif has dpkg; then
if [ "${ARCH}" != "x86_64" ]; then # It's okay on AUR; not on other distros if [ "${ARCH}" != "x86_64" ]; then # It's okay on AUR; not on other distros
try_with_cargo "we don't distribute packages for ${ARCH} at the moment" try_with_cargo "we don't distribute packages for ${ARCH} at the moment" "linux"
else else
info "Detected dpkg on your system" info "Detected dpkg on your system"
info "Installing ${GREEN}termscp${NO_COLOR} via Debian package" info "Installing ${GREEN}termscp${NO_COLOR} via Debian package"
@@ -234,7 +234,7 @@ install_on_linux() {
fi fi
elif has rpm; then elif has rpm; then
if [ "${ARCH}" != "x86_64" ]; then # It's okay on AUR; not on other distros if [ "${ARCH}" != "x86_64" ]; then # It's okay on AUR; not on other distros
try_with_cargo "we don't distribute packages for ${ARCH} at the moment" try_with_cargo "we don't distribute packages for ${ARCH} at the moment" "linux"
else else
info "Detected rpm on your system" info "Detected rpm on your system"
info "Installing ${GREEN}termscp${NO_COLOR} via RPM package" info "Installing ${GREEN}termscp${NO_COLOR} via RPM package"
@@ -255,7 +255,7 @@ install_on_linux() {
rm -f ${archive} rm -f ${archive}
fi fi
else else
try_with_cargo "No suitable installation method found for your Linux distribution; if you're running on Arch linux, please install an AUR package manager (such as yay). Currently only Arch, Debian based and Red Hat based distros are supported" try_with_cargo "No suitable installation method found for your Linux distribution; if you're running on Arch linux, please install an AUR package manager (such as yay). Currently only Arch, Debian based and Red Hat based distros are supported" "linux"
fi fi
} }
@@ -279,7 +279,7 @@ install_on_macos() {
brew install veeso/termscp/${FORMULA} brew install veeso/termscp/${FORMULA}
fi fi
else else
try_with_cargo "brew is missing on your system; please install it from <https://brew.sh/>" try_with_cargo "brew is missing on your system; please install it from <https://brew.sh/>" "macos"
fi fi
} }
@@ -350,11 +350,12 @@ install_cargo() {
try_with_cargo() { try_with_cargo() {
err="$1" err="$1"
platform="$2"
# Install cargo # Install cargo
install_cargo install_cargo
if has cargo; then if has cargo; then
info "Installing ${GREEN}termscp${NO_COLOR} via Cargo…" info "Installing ${GREEN}termscp${NO_COLOR} via Cargo…"
case $PLATFORM in case $platform in
"freebsd") "freebsd")
install_bsd_cargo_deps install_bsd_cargo_deps
cargo install --locked --no-default-features termscp cargo install --locked --no-default-features termscp