diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-08-02 08:32:22 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-08-02 08:32:22 +0300 |
commit | a491e86d92a2cdd45373d0d16bb52ba6ec34366b (patch) | |
tree | 4c8c054bc3a20cc8c3aa075e2f8b343c65454127 /internal | |
parent | 0f00e5e9e26a19b393ba54aa03f6a947fa21bb65 (diff) |
beautify temp file name when printing it
Diffstat (limited to 'internal')
-rwxr-xr-x | internal/wizard.zsh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 6d18f2ed..2d2ef2f6 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -787,8 +787,9 @@ function ask_config_overwrite() { q) quit;; r) return 1;; y) - config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || return 1 - cp $__p9k_cfg_path $config_backup + config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || exit 1 + cp $__p9k_cfg_path $config_backup || exit 1 + config_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)config_backup:t} write_config=1 break ;; @@ -966,7 +967,7 @@ fi source $__p9k_root_dir/internal/icons.zsh || return while true; do - local POWERLEVEL9K_MODE= style= config_backup= gap_char=' ' + local POWERLEVEL9K_MODE= style= config_backup= config_backup_u= gap_char=' ' local left_subsep= right_subsep= left_tail= right_tail= left_head= right_head= local -i num_lines=0 write_config=0 empty_line=0 color=2 left_frame=1 right_frame=1 local -i cap_diamond=0 cap_python=0 cap_narrow_icons=0 cap_lock=0 @@ -1033,7 +1034,7 @@ clear print -P "Powerlevel10k configuration has been written to %2F$__p9k_cfg_path_u%f." if [[ -n $config_backup ]]; then - print -P "The backup of the previuos version is at %3F$config_backup%f." + print -P "The backup of the previuos version is at %3F$config_backup_u%f." fi if (( write_config )); then |