mirror of
https://github.com/nahuhh/basicswap-bash.git
synced 2024-11-16 15:57:38 +00:00
install: fix mac detection
This commit is contained in:
parent
b0a83f63a3
commit
4b7cbe98b4
1 changed files with 13 additions and 13 deletions
26
install.sh
26
install.sh
|
@ -45,7 +45,19 @@ check_tails() {
|
|||
}
|
||||
|
||||
detect_os_arch() {
|
||||
if type -P apt > /dev/null; then
|
||||
if [[ $(uname -s) = "Darwin" ]]; then
|
||||
# MacOS
|
||||
export MACOS=1
|
||||
if type -P brew > /dev/null; then
|
||||
$green"Homebrew is installed\n";$nc
|
||||
INSTALL="brew install"
|
||||
else
|
||||
$green"Installing Homebrew\n";$nc
|
||||
INSTALL="curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | /bin/bash && brew install"
|
||||
fi
|
||||
DEPENDENCY="python gnupg pkg-config"
|
||||
$green"\nDetected MacOS\n";$nocolor
|
||||
elif type -P apt > /dev/null; then
|
||||
check_tails
|
||||
# Debian / Ubuntu / Mint
|
||||
INSTALL="sudo apt install"
|
||||
|
@ -63,18 +75,6 @@ detect_os_arch() {
|
|||
UPDATE="sudo pacman -Syu"
|
||||
DEPENDENCY="python-pipenv gnupg pkgconf base-devel"
|
||||
$green"\nDetected Arch Linux\n";$nocolor
|
||||
elif [[ $(uname -s) = "Darwin" ]]; then
|
||||
# MacOS
|
||||
export MACOS=1
|
||||
if type -P brew > /dev/null; then
|
||||
$green"Homebrew is installed\n";$nc
|
||||
INSTALL="brew install"
|
||||
else
|
||||
$green"Installing Homebrew\n";$nc
|
||||
INSTALL="curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | /bin/bash && brew install"
|
||||
fi
|
||||
DEPENDENCY="python gnupg pkg-config"
|
||||
$green"\nDetected MacOS\n";$nocolor
|
||||
else
|
||||
$red"Failed to detect OS. Unsupported or unknown distribution.\nInstall Failed.";$nocolor
|
||||
exit
|
||||
|
|
Loading…
Reference in a new issue