From 61e16f96c5c4c0a91631c624b0e995c195f28c1f Mon Sep 17 00:00:00 2001 From: UUBulb <35923940+uubulb@users.noreply.github.com> Date: Tue, 25 Jun 2024 23:00:30 +0800 Subject: [PATCH] fix: EUID is a readonly variable on some shells (#379) --- script/install.sh | 4 ++-- script/install_en.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/script/install.sh b/script/install.sh index e741406..8f98d80 100755 --- a/script/install.sh +++ b/script/install.sh @@ -24,8 +24,8 @@ os_arch="" [ -e /etc/os-release ] && grep -i "PRETTY_NAME" /etc/os-release | grep -qi "alpine" && os_alpine='1' sudo() { - EUID=$(id -ru) - if [ "$EUID" -ne 0 ]; then + myEUID=$(id -ru) + if [ "$myEUID" -ne 0 ]; then if command -v sudo > /dev/null 2>&1; then command sudo "$@" else diff --git a/script/install_en.sh b/script/install_en.sh index 6d2c623..9f6c8b0 100755 --- a/script/install_en.sh +++ b/script/install_en.sh @@ -24,8 +24,8 @@ os_arch="" [ -e /etc/os-release ] && grep -i "PRETTY_NAME" /etc/os-release | grep -qi "alpine" && os_alpine='1' sudo() { - EUID=$(id -ru) - if [ "$EUID" -ne 0 ]; then + myEUID=$(id -ru) + if [ "$myEUID" -ne 0 ]; then if command -v sudo > /dev/null 2>&1; then command sudo "$@" else