Unquote the new variables inside [[ ]]
AGENTS.md asks for unquoted variables inside `[[ ]]`, with quotes reserved for string literals being compared. The three conditions added here quoted them. 🤖 Generated by Opus 5 in Claude Code. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Codex XHigh <noreply@openai.com>
This commit is contained in:
co-authored by
Claude Opus 5
Codex XHigh
parent
9d8c0176d1
commit
d1845245d3
@@ -8,7 +8,7 @@
|
|||||||
# caching (detect every run) rather than fall back to a predictable, world-writable
|
# caching (detect every run) rather than fall back to a predictable, world-writable
|
||||||
# /tmp path another user could pre-create.
|
# /tmp path another user could pre-create.
|
||||||
device_cache=""
|
device_cache=""
|
||||||
if [[ -n "${XDG_RUNTIME_DIR:-}" ]]; then
|
if [[ -n ${XDG_RUNTIME_DIR:-} ]]; then
|
||||||
device_cache="$XDG_RUNTIME_DIR/omarchy-brightness-display-apple.device"
|
device_cache="$XDG_RUNTIME_DIR/omarchy-brightness-display-apple.device"
|
||||||
fi
|
fi
|
||||||
no_osd=0
|
no_osd=0
|
||||||
@@ -34,7 +34,7 @@ find_apple_display_device() {
|
|||||||
local cached=""
|
local cached=""
|
||||||
local device=""
|
local device=""
|
||||||
|
|
||||||
if [[ -n "$device_cache" && -r $device_cache ]]; then
|
if [[ -n $device_cache && -r $device_cache ]]; then
|
||||||
read -r cached <"$device_cache" || true
|
read -r cached <"$device_cache" || true
|
||||||
# Trust a cached value only if it still names a hiddev character device. A
|
# Trust a cached value only if it still names a hiddev character device. A
|
||||||
# stale or unexpected cache (a regular file, a non-hiddev node) is ignored and
|
# stale or unexpected cache (a regular file, a non-hiddev node) is ignored and
|
||||||
@@ -50,7 +50,7 @@ find_apple_display_device() {
|
|||||||
device="$(detect_apple_display_device)" || return 1
|
device="$(detect_apple_display_device)" || return 1
|
||||||
[[ -n $device ]] || return 1
|
[[ -n $device ]] || return 1
|
||||||
|
|
||||||
if [[ -n "$device_cache" ]]; then
|
if [[ -n $device_cache ]]; then
|
||||||
printf '%s\n' "$device" >"$device_cache"
|
printf '%s\n' "$device" >"$device_cache"
|
||||||
fi
|
fi
|
||||||
printf '%s\n' "$device"
|
printf '%s\n' "$device"
|
||||||
|
|||||||
Reference in New Issue
Block a user