Skip to content

Commit 64b5873

Browse files
committed
improve
1 parent 1f77721 commit 64b5873

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

usr/bin/gsudo-wl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ fi
2323

2424
if [ "$(id --user)" != '0' ]; then
2525
true "INFO: Not running as root. Re-executing using sudo."
26-
sudo -- "$0" "$@"
26+
if test -o xtrace; then
27+
## XXX: Might add a superfluous ':xtrace'.
28+
sudo -- env SHELLOPTS="${SHELLOPTS-}:xtrace" "$0" "$@"
29+
else
30+
sudo -- "$0" "$@"
31+
fi
2732
exit "$?"
2833
fi
2934

usr/bin/gsudo-x

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ fi
2828

2929
if [ "$(id --user)" != '0' ]; then
3030
true "INFO: Not running as root. Re-executing using sudo."
31-
sudo DISPLAY="${DISPLAY-}" "$0" "$@"
31+
if test -o xtrace; then
32+
## XXX: Might add a superfluous ':xtrace'.
33+
sudo -- env SHELLOPTS="${SHELLOPTS-}:xtrace" DISPLAY="${DISPLAY-}" "$0" "$@"
34+
else
35+
sudo DISPLAY="${DISPLAY-}" -- "$0" "$@"
36+
fi
3237
exit "$?"
3338
fi
3439

0 commit comments

Comments
 (0)