avoid sh word splitting on paths
This commit is contained in:
parent
3673fd9f08
commit
0d21095877
1 changed files with 2 additions and 3 deletions
|
@ -14,14 +14,13 @@ plugin_dir_exists() {
|
||||||
# No errors if the plugin dir does not exist.
|
# No errors if the plugin dir does not exist.
|
||||||
silently_source_all_tmux_files() {
|
silently_source_all_tmux_files() {
|
||||||
local plugin_path="$1"
|
local plugin_path="$1"
|
||||||
local plugin_tmux_files="$plugin_path*.tmux"
|
|
||||||
if plugin_dir_exists "$plugin_path"; then
|
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
|
# if the glob didn't find any files this will be the
|
||||||
# unexpanded glob which obviously doesn't exist
|
# unexpanded glob which obviously doesn't exist
|
||||||
[ -f "$tmux_file" ] || continue
|
[ -f "$tmux_file" ] || continue
|
||||||
# runs *.tmux file as an executable
|
# runs *.tmux file as an executable
|
||||||
$tmux_file >/dev/null 2>&1
|
"$tmux_file" >/dev/null 2>&1
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue