Fix some line return `config` bugs

This commit is contained in:
rwxrob 2021-08-26 10:00:16 -04:00
parent d4cd7301f8
commit 4aabdc934c
No known key found for this signature in database
GPG Key ID: 1CCACEDD2F65578E
1 changed files with 7 additions and 5 deletions

12
cmd
View File

@ -269,9 +269,9 @@ portability.'
command_config() { command_config() {
case $1 in case $1 in
dir) _config_dir ;; dir) _config_dir; return $? ;;
path) _config_path ;; path) _config_path; return $? ;;
edit) _config_edit ;; edit) _config_edit; return $? ;;
esac esac
case $# in case $# in
0) _config_dump ;; 0) _config_dump ;;
@ -290,12 +290,14 @@ _config_dir() {
[[ -n "$XDG_CONFIG_HOME" ]] && dir="$XDG_CONFIG_HOME/$EXE" [[ -n "$XDG_CONFIG_HOME" ]] && dir="$XDG_CONFIG_HOME/$EXE"
[[ -n "$CONFIG_DIR" ]] && dir="$CONFIG_DIR" [[ -n "$CONFIG_DIR" ]] && dir="$CONFIG_DIR"
[[ -n "$1" ]] && echo "$dir/$1" && return 0 [[ -n "$1" ]] && echo "$dir/$1" && return 0
echo "$dir" printf "%s" "$dir"
[[ -t 1 ]] && echo
} }
_config_path() { _config_path() {
local file=${1:-values} local file=${1:-values}
printf "%s/%s\n" "$(_config_dir)" "$file" printf "%s/%s" "$(_config_dir)" "$file"
[[ -t 1 ]] && echo
} }
_config_set() { _config_set() {