From 0d2109587722bc97175e8e8fc45b50e3805ffb38 Mon Sep 17 00:00:00 2001 From: Bao Date: Mon, 13 Nov 2023 09:50:21 -0600 Subject: [PATCH] avoid sh word splitting on paths --- scripts/source_plugins.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/source_plugins.sh b/scripts/source_plugins.sh index 6381d54..c53e041 100755 --- a/scripts/source_plugins.sh +++ b/scripts/source_plugins.sh @@ -14,14 +14,13 @@ plugin_dir_exists() { # No errors if the plugin dir does not exist. silently_source_all_tmux_files() { local plugin_path="$1" - local plugin_tmux_files="$plugin_path*.tmux" if plugin_dir_exists "$plugin_path"; then - for tmux_file in $plugin_tmux_files; do + for tmux_file in "$plugin_path"/*.tmux; do # if the glob didn't find any files this will be the # unexpanded glob which obviously doesn't exist [ -f "$tmux_file" ] || continue # runs *.tmux file as an executable - $tmux_file >/dev/null 2>&1 + "$tmux_file" >/dev/null 2>&1 done fi }