Skip to content

Commit 92a8d53

Browse files
committed
fix: yq when user config is missing
1 parent f0bfaff commit 92a8d53

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/tmux-nerd-font-window-name

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ USER_CONFIG="$HOME/.config/tmux/tmux-nerd-font-window-name.yml"
88
get_config_value() {
99
local key=$1
1010
local value
11-
value="$(yq "$key" "$USER_CONFIG")"
12-
if [ "$value" == "null" ]; then # get default config value
11+
if test -f "$USER_CONFIG"; then
12+
value="$(yq "$key" "$USER_CONFIG")"
13+
if [ "$value" == "null" ]; then # get default config value
14+
value="$(yq "$key" "$DEFAULT_CONFIG")"
15+
fi
16+
else
1317
value="$(yq "$key" "$DEFAULT_CONFIG")"
1418
fi
1519
echo "$value"

0 commit comments

Comments
 (0)