26151d2f54
and replace the foreground color and bold expansions by ANSI escape codes. This should make the print calls now safe and no expansion at all should happen as we're using `-R` -- unless the `-e` flag is given. Fixes #521. Closes #522
13 lines
467 B
Plaintext
13 lines
467 B
Plaintext
_zimfw_mv() {
|
|
local -a cklines
|
|
if cklines=(${(f)"$(command cksum ${1} ${2} 2>/dev/null)"}) && \
|
|
[[ ${${(z)cklines[1]}[1,2]} == ${${(z)cklines[2]}[1,2]} ]]; then
|
|
_zimfw_print -R $'<%= okay %><%= bold %>'${2}$':<%= normal %> Already up to date'
|
|
else
|
|
if [[ -e ${2} ]]; then
|
|
command mv -f ${2}{,.old} || return 1
|
|
fi
|
|
command mv -f ${1} ${2} && _zimfw_print -R $'<%= okay %><%= bold %>'${2}$':<%= normal %> Updated.'${_zrestartmsg}
|
|
fi
|
|
}
|