fix: replace 'uname -a' with 'uname -srm' for OS/Arch detection

This commit is contained in:
AJ ONeal
2023-02-11 21:32:51 +00:00
parent b5fc4d742b
commit 5b6b700943
7 changed files with 9 additions and 9 deletions

View File

@@ -15,7 +15,7 @@ __install_webi() {
export WEBI_HOST
echo ""
printf "Thanks for using webi to install '\e[32m%s\e[0m' on '\e[31m%s/%s\e[0m'.\n" "${WEBI_PKG-}" "$(uname -s)" "$(uname -m)"
printf "Thanks for using webi to install '\e[32m%s\e[0m' on '\e[31m%s/%s\e[0m'.\n" "${WEBI_PKG-}" "$(uname -s)/$(uname -r)" "$(uname -m)"
echo "Have a problem? Experience a bug? Please let us know:"
echo " https://github.com/webinstall/webi-installers/issues"
echo ""
@@ -93,7 +93,7 @@ __webi_main() {
set -e
export WEBI_HOST="\${WEBI_HOST:-https://webinstall.dev}"
export WEBI_UA="\$(uname -a)"
export WEBI_UA="\$(uname -s)/\$(uname -r) \$(uname -m)/unknown"
webinstall() {
@@ -220,7 +220,7 @@ EOF
echo ""
echo "Hmm... no WEBI_PKG was specified. This is probably an error in the script."
echo ""
echo "Please open an issue with this information: Package '${WEBI_PKG-}' on '$(uname -s)/$(uname -m)'"
echo "Please open an issue with this information: Package '${WEBI_PKG-}' on '$(uname -s)/$(uname -r) $(uname -m)'"
echo " https://github.com/webinstall/packages/issues"
echo ""
fi

View File

@@ -30,7 +30,7 @@ __bootstrap_webi() {
#PKG_OSES=
#PKG_ARCHES=
#PKG_FORMATS=
WEBI_UA="$(uname -a)"
WEBI_UA="$(uname -s)/$(uname -r) $(uname -m)/unknown"
WEBI_PKG_DOWNLOAD=""
WEBI_DOWNLOAD_DIR="${HOME}/Downloads"
if command -v xdg-user-dir > /dev/null; then

View File

@@ -16,7 +16,7 @@ function getRequest(req) {
}
return {
unix: 'curl -fsSA "$(uname -a)" ' + url,
unix: 'curl -fsSA "$(uname -srm)" ' + url,
windows: 'curl.exe -fsSA "MS $Env:PROCESSOR_ARCHITECTURE" ' + url,
ua: ua,
os: uaDetect.os(ua),

View File

@@ -7,7 +7,7 @@ _install_brew() {
# Straight from https://brew.sh
#/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
if uname -a | grep -q -i darwin; then
if [ "Darwin" = "$(uname -s)" ]; then
needs_xcode="$(/usr/bin/xcode-select -p > /dev/null 2> /dev/null || echo "true")"
if [ -n "${needs_xcode}" ]; then
echo ""

View File

@@ -2,7 +2,7 @@
set -e
set -u
if ! (uname -a | grep -i "darwin" > /dev/null); then
if [ "Darwin" != "$(uname -s)" ]; then
echo "No fish installer for Linux yet. Try this instead:"
echo " sudo apt install -y fish"
exit 1

View File

@@ -5,7 +5,7 @@ set -u
__init_git() {
if [ -z "$(command -v git)" ]; then
if uname -a | grep -q -i darwin; then
if [ "Darwin" = "$(uname -s)" ]; then
echo >&2 "Error: 'git' not found. You may have to re-install 'git' on Mac after every major update."
echo >&2 " for example, try: xcode-select --install"
# sudo xcodebuild -license accept

View File

@@ -4,7 +4,7 @@ set -e
set -u
_install_gpg() {
if ! (uname -a | grep -i "darwin" > /dev/null); then
if [ "Darwin" != "$(uname -s)" ]; then
echo "No gpg installer for Linux yet. Try this instead:"
echo " sudo apt install -y gpg gnupg"
exit 1