mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
don't invoke mktemp if it doesn't exist
This commit is contained in:
parent
8d47270e8c
commit
6609767abd
1 changed files with 4 additions and 1 deletions
|
@ -1638,7 +1638,10 @@ function ask_zshrc_edit() {
|
|||
local tmpdir=/tmp
|
||||
local tmpdir_u=/tmp
|
||||
fi
|
||||
zshrc_backup="$(mktemp $tmpdir/.zshrc.XXXXXXXXXX)" || quit -c
|
||||
if (( ! $+commands[mktemp] )) ||
|
||||
! zshrc_backup="$(mktemp $tmpdir/.zshrc.XXXXXXXXXX 2>/dev/null)"; then
|
||||
zshrc_backup=$tmpdir/.zshrc.$EPOCHREALTIME
|
||||
fi
|
||||
cp -p $__p9k_zshrc $zshrc_backup || quit -c
|
||||
local -i writable=1
|
||||
if [[ ! -w $zshrc_backup ]]; then
|
||||
|
|
Loading…
Reference in a new issue