Skip to content

Commit

Permalink
Merge pull request #353 from fox-forks/hyperupcall-code
Browse files Browse the repository at this point in the history
fix: Quote path variables and avoid `-o`/`-a` flags to `[`
  • Loading branch information
erikw authored Jan 6, 2024
2 parents 25cf067 + db3c893 commit c10d55d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions config/helpers.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Other settings and helper functions.

debug_mode_enabled() {
[ -n "$TMUX_POWERLINE_DEBUG_MODE_ENABLED" -a "$TMUX_POWERLINE_DEBUG_MODE_ENABLED" != "false" ];
[ -n "$TMUX_POWERLINE_DEBUG_MODE_ENABLED" ] && [ "$TMUX_POWERLINE_DEBUG_MODE_ENABLED" != "false" ];
}

patched_font_in_use() {
[ -z "$TMUX_POWERLINE_PATCHED_FONT_IN_USE" -o "$TMUX_POWERLINE_PATCHED_FONT_IN_USE" != "false" ];
[ -z "$TMUX_POWERLINE_PATCHED_FONT_IN_USE" ] || [ "$TMUX_POWERLINE_PATCHED_FONT_IN_USE" != "false" ];
}
2 changes: 1 addition & 1 deletion lib/arg_processing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

check_arg_side() {
local side="$1"
if ! [ "$side" == "left" -o "$side" == "right" -o "$side" == "init" ]; then
if ! [[ "$side" == "left" || "$side" == "right" || "$side" == "init" ]]; then
echo "Argument must be the side to handle {left, right} or {init} and not \"${side}\"."
exit 1
fi
Expand Down
8 changes: 4 additions & 4 deletions lib/muting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# In all cases $1 is the side to be muted (eg left/right).

powerline_muted() {
[ -e "$(__powerline_mute_file $1)" ];
[ -e "$(__powerline_mute_file "$1")" ];
}

toggle_powerline_mute_status() {
if powerline_muted $1; then
rm "$(__powerline_mute_file $1)"
if powerline_muted "$1"; then
rm "$(__powerline_mute_file "$1")"
else
touch "$(__powerline_mute_file $1)"
touch "$(__powerline_mute_file "$1")"
fi
}

Expand Down

0 comments on commit c10d55d

Please sign in to comment.