Use os-release file to check Ubuntu distro (#381)

Previous check uname -a does not work if user has changed kernel.
Use os-release for true operating system identification.
This commit is contained in:
Simon Fontana Oscarsson 2021-05-09 17:22:29 +02:00 committed by GitHub
parent 4de1cb5a57
commit 123dfca594
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,7 @@ installnodefedora() {
installnode() {
echo "Installing node..."
[ "$(uname)" == "Darwin" ] && installnodemac
[ -n "$(uname -a | grep Ubuntu)" ] && installnodeubuntu
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installnodeubuntu
[ -f "/etc/arch-release" ] && installnodearch
[ -f "/etc/artix-release" ] && installnodearch
[ -f "/etc/fedora-release" ] && installnodefedora
@ -62,7 +62,7 @@ installpiponfedora() {
installpip() {
echo "Installing pip..."
[ "$(uname)" == "Darwin" ] && installpiponmac
[ -n "$(uname -a | grep Ubuntu)" ] && installpiponubuntu
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installpiponubuntu
[ -f "/etc/arch-release" ] && installpiponarch
[ -f "/etc/fedora-release" ] && installpiponfedora
[ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && echo "Windows not currently supported"
@ -135,7 +135,7 @@ installonfedora() {
installextrapackages() {
[ "$(uname)" == "Darwin" ] && installonmac
[ -n "$(uname -a | grep Ubuntu)" ] && installonubuntu
[ -n "$(cat /etc/os-release | grep Ubuntu)" ] && installonubuntu
[ -f "/etc/arch-release" ] && installonarch
[ -f "/etc/artix-release" ] && installonarch
[ -f "/etc/fedora-release" ] && installonfedora