Make the install script more robust (#692)
Dont't fail is a Linux system does not provide lsb_release, try to read the distro from /etc/os-release in this case.
This commit is contained in:
parent
2cec7ba677
commit
ae2124a69c
1 changed files with 8 additions and 13 deletions
21
install.sh
21
install.sh
|
@ -81,22 +81,17 @@ __atuin_install_ubuntu(){
|
||||||
__atuin_install_linux(){
|
__atuin_install_linux(){
|
||||||
echo "Detected Linux!"
|
echo "Detected Linux!"
|
||||||
echo "Checking distro..."
|
echo "Checking distro..."
|
||||||
|
|
||||||
if (uname -a | grep -qi "Microsoft"); then
|
if (uname -a | grep -qi "Microsoft"); then
|
||||||
OS="UbuntuWSL"
|
OS="UbuntuWSL"
|
||||||
else
|
elif ! command -v lsb_release &> /dev/null; then
|
||||||
if ! command -v lsb_release &> /dev/null; then
|
echo "lsb_release could not be found. Falling back to /etc/os-release"
|
||||||
echo "lsb_release could not be found, unable to determine your distribution"
|
OS="$(grep -Po '(?<=^ID=).*$' /etc/os-release)" 2>/dev/null
|
||||||
echo "If you are using Arch Linux, please get community/lsb-release or install Atuin using pacman"
|
else
|
||||||
echo
|
OS=$(lsb_release -i | awk '{ print $3 }')
|
||||||
__atuin_install_unsupported
|
fi
|
||||||
fi
|
|
||||||
OS=$(lsb_release -i | awk '{ print $3 }')
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$OS" == "Arch" ] || [ "$OS" == "ManjaroLinux" ]; then
|
if [ "$OS" == "Arch" ] || [ "$OS" == "ManjaroLinux" ]; then
|
||||||
__atuin_install_arch
|
__atuin_install_arch
|
||||||
elif [ "$OS" == "Ubuntu" ] || [ "$OS" == "UbuntuWSL" ] || [ "$OS" == "Debian" ] || [ "$OS" == "Linuxmint" ] || [ "$OS" == "Parrot" ] || [ "$OS" == "Kali" ] || [ "$OS" == "Elementary" ] || [ "$OS" == "Pop" ]; then
|
elif [ "$OS" == "Ubuntu" ] || [ "$OS" == "UbuntuWSL" ] || [ "$OS" == "Debian" ] || [ "$OS" == "Linuxmint" ] || [ "$OS" == "Parrot" ] || [ "$OS" == "Kali" ] || [ "$OS" == "Elementary" ] || [ "$OS" == "Pop" ]; then
|
||||||
__atuin_install_ubuntu
|
__atuin_install_ubuntu
|
||||||
else
|
else
|
||||||
# TODO: download a binary or smth
|
# TODO: download a binary or smth
|
||||||
|
|
Loading…
Reference in a new issue