e73285c4d1
so it behaves similar to `cmp -s`, which is what we had before.
14 lines
466 B
Plaintext
14 lines
466 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 -PR "<%= okay %>%B${2}:%b Already up to date"
|
|
else
|
|
if [[ -e ${2} ]]; then
|
|
command mv -f ${2}{,.old} || return 1
|
|
fi
|
|
command mv -f ${1} ${2} && \
|
|
_zimfw_print -PR "<%= okay %>%B${2}:%b Updated. Restart your terminal for changes to take effect."
|
|
fi
|
|
}
|