zimfw/tools/zim_update

37 lines
864 B
Plaintext

#
# zim_update - update the zim repository
#
echo "\nUpdating Zim"
cd ${ZIM_HOME}
# this is the cleanest way I know how to update a repository
git remote update -p
git merge --ff-only @\{u\}
# and update the submodules
git submodule update --init --recursive
# Source user configuration
[[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc
# Update zmodules
for zmodule in ${zmodules}; do
dir=${${${zmodule%/}%.git}##*/}
if [ -d ${ZIM_HOME}/modules/${dir} ]; then
print "\nUpdating ${zmodule} module"
cd ${ZIM_HOME}/modules/${dir}
# update the modules repository
git remote update -p
git merge --ff-only @\{u\}
# and update the submodules
git submodule update --init --recursive
else
print "\nNo such module \"${zmodule}\", run \"zmanage install\" to install missing modules" >&2
fi
done
print