Merge pull request #11495 from lalvarezt/command-operands-as-literal
Treat command operands as literal values
This commit is contained in:
15 files changed
+310
-26
No files matched your search
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Check whether any required commands are missing
|
||||
|
||||
for cmd in "$@"; do
|
||||
if ! command -v "$cmd" &>/dev/null; then
|
||||
if ! command -v -- "$cmd" &>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Check whether all required commands are available
|
||||
|
||||
for cmd in "$@"; do
|
||||
command -v "$cmd" &>/dev/null || exit 1
|
||||
command -v -- "$cmd" &>/dev/null || exit 1
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -27,7 +27,7 @@ if [[ -z $HOOK_TYPE || $HOOK_TYPE == */* || $HOOK_TYPE == "." || $HOOK_TYPE == "
|
||||
fi
|
||||
|
||||
HOOK_DIR="$HOME/.config/omarchy/hooks/$HOOK_TYPE.d"
|
||||
HOOK_NAME=$(basename "$HOOK_FILE")
|
||||
HOOK_NAME=$(basename -- "$HOOK_FILE")
|
||||
HOOK_PATH="$HOOK_DIR/$HOOK_NAME"
|
||||
|
||||
if [[ ! -f $HOOK_FILE ]]; then
|
||||
@@ -36,7 +36,7 @@ if [[ ! -f $HOOK_FILE ]]; then
|
||||
fi
|
||||
|
||||
mkdir -p "$HOOK_DIR"
|
||||
cp "$HOOK_FILE" "$HOOK_PATH"
|
||||
cp -- "$HOOK_FILE" "$HOOK_PATH"
|
||||
chmod 755 "$HOOK_PATH"
|
||||
|
||||
echo "Installed $HOOK_TYPE hook: $HOOK_PATH"
|
||||
@@ -3,5 +3,5 @@
|
||||
# omarchy:summary=Match against the computer's DMI product name or product family (case-insensitive).
|
||||
# omarchy:args=<pattern>
|
||||
|
||||
grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null ||
|
||||
grep -qi "$1" /sys/class/dmi/id/product_family 2>/dev/null
|
||||
grep -qi -- "$1" /sys/class/dmi/id/product_name 2>/dev/null ||
|
||||
grep -qi -- "$1" /sys/class/dmi/id/product_family 2>/dev/null
|
||||
@@ -26,12 +26,12 @@ omarchy-cmd-present "$editor" || editor="nvim"
|
||||
case "${editor##*/}" in
|
||||
nvim | vim | nano | micro | hx | helix | fresh)
|
||||
if [[ $inline == "true" ]]; then
|
||||
exec "$editor" "$@"
|
||||
exec "$editor" -- "$@"
|
||||
else
|
||||
exec omarchy-launch-tui "$editor" "$@"
|
||||
exec omarchy-launch-tui "$editor" -- "$@"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exec setsid uwsm-app -- "$editor" "$@"
|
||||
exec setsid uwsm-app -- "$editor" -- "$@"
|
||||
;;
|
||||
esac
|
||||
+3
-3
@@ -7,15 +7,15 @@
|
||||
|
||||
if omarchy-pkg-missing "$@"; then
|
||||
if (( EUID == 0 )); then
|
||||
pacman -S --noconfirm --needed "$@" || exit 1
|
||||
pacman -S --noconfirm --needed -- "$@" || exit 1
|
||||
else
|
||||
sudo pacman -S --noconfirm --needed "$@" || exit 1
|
||||
sudo pacman -S --noconfirm --needed -- "$@" || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
for pkg in "$@"; do
|
||||
# Secondary check to handle states where pacman doesn't actually register an error
|
||||
if ! pacman -Q "$pkg" &>/dev/null; then
|
||||
if ! pacman -Q -- "$pkg" &>/dev/null; then
|
||||
echo -e "\033[31mError: Package '$pkg' did not install\033[0m" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
# omarchy:args=<packages...>
|
||||
|
||||
if omarchy-pkg-missing "$@"; then
|
||||
yay -S --noconfirm --needed "$@" || exit 1
|
||||
yay -S --noconfirm --needed -- "$@" || exit 1
|
||||
fi
|
||||
|
||||
for pkg in "$@"; do
|
||||
# Secondary check to handle states where pacman doesn't actually register an error
|
||||
if ! pacman -Q "$pkg" &>/dev/null; then
|
||||
if ! pacman -Q -- "$pkg" &>/dev/null; then
|
||||
echo -e "\033[31mError: Package '$pkg' did not install\033[0m" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# omarchy:args=<packages...>
|
||||
|
||||
for pkg in "$@"; do
|
||||
if ! pacman -Q "$pkg" &>/dev/null; then
|
||||
if ! pacman -Q -- "$pkg" &>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# omarchy:args=<packages...>
|
||||
|
||||
for pkg in "$@"; do
|
||||
pacman -Q "$pkg" &>/dev/null || exit 1
|
||||
pacman -Q -- "$pkg" &>/dev/null || exit 1
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -3,5 +3,5 @@
|
||||
# omarchy:summary=Restart an application by killing it and relaunching via uwsm.
|
||||
# omarchy:args=<application-name> [application-args...]
|
||||
|
||||
pkill -x $1
|
||||
pkill -x -- "$1"
|
||||
setsid uwsm-app -- "$@" >/dev/null 2>&1 &
|
||||
@@ -80,7 +80,7 @@ fi
|
||||
# one transaction, so a failed install leaves the existing driver in place.
|
||||
if omarchy-pkg-missing libfprint-git fprintd usbutils; then
|
||||
echo "Installing required packages..."
|
||||
sudo pacman -S --needed --noconfirm --ask 4 libfprint-git fprintd usbutils
|
||||
sudo pacman -S --needed --noconfirm --ask 4 -- libfprint-git fprintd usbutils
|
||||
fi
|
||||
|
||||
# Enroll first fingerprint
|
||||
|
||||
Reference in new issue
Block a user