fix: skip doas/sudo escalation for install under MSYS2
Neither doas nor sudo exist there and id -u never reports root, so install/uninstall always hit the no-root error. IS_WIN is now computed once alongside MK_FILE and reused for the priv check.
This commit is contained in:
1 parent
429c8a55e7
commit
46a05c0e88
2 files changed
+7
-1
No files matched your search
@@ -11,6 +11,11 @@ else
|
||||
MK_FILE="gmake.mk"
|
||||
fi
|
||||
|
||||
case "$OS" in
|
||||
mingw*|msys*|ucrt*|clang*) IS_WIN=1 ;;
|
||||
*) IS_WIN=0 ;;
|
||||
esac
|
||||
|
||||
if grep -q "Raspberry Pi 5" /proc/device-tree/model 2>/dev/null; then
|
||||
GL_MAJOR=3
|
||||
GL_MINOR=1
|
||||
@@ -33,7 +38,7 @@ if [ "$HAS_INSTALL" = "1" ] || [ "$HAS_UNINSTALL" = "1" ]; then
|
||||
make -f "$MK_FILE" release GL_MAJOR=$GL_MAJOR GL_MINOR=$GL_MINOR
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
if [ "$IS_WIN" = "1" ] || [ "$(id -u)" = "0" ]; then
|
||||
PRIV=""
|
||||
elif command -v doas > /dev/null 2>&1; then
|
||||
PRIV="doas"
|
||||
|
||||
Reference in new issue
Block a user