From 1cdc7055122eae4a260b0f6f5aaa5522af145e43 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 4 Oct 2015 15:04:21 -0400 Subject: Be more careful about what happens when XDG_RUNTIME_DIR isn't set. --- .config/wmii-hg/include.sh | 4 ++++ .config/wmii-hg/rbar.sh | 5 +++++ 2 files changed, 9 insertions(+) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/include.sh b/.config/wmii-hg/include.sh index 4e86276..f8c4e0d 100644 --- a/.config/wmii-hg/include.sh +++ b/.config/wmii-hg/include.sh @@ -1,4 +1,8 @@ #!/hint/bash +if [[ -z "$XDG_RUNTIME_DIR" ]]; then + printf "XDG_RUNTIME_DIR isn't set\n" >&2 + exit 6 +fi if [[ -z "$WMII_NAMESPACE" ]]; then export WMII_NAMESPACE="$(wmiir namespace)" diff --git a/.config/wmii-hg/rbar.sh b/.config/wmii-hg/rbar.sh index 0c9efa6..287f427 100644 --- a/.config/wmii-hg/rbar.sh +++ b/.config/wmii-hg/rbar.sh @@ -1,4 +1,9 @@ #!/hint/bash +if [[ -z "$XDG_RUNTIME_DIR" ]]; then + printf "XDG_RUNTIME_DIR isn't set\n" >&2 + exit 6 +fi + setup_trap() { trap "rm -f -- \"\${XDG_RUNTIME_DIR}\"/n/wmii*/rbar/${1}" EXIT } -- cgit v1.2.3