1
0
Fork 0
mirror of synced 2024-06-16 13:51:10 -04:00
zimfw/tools/zim_update

35 lines
834 B
Plaintext
Raw Normal View History

2016-05-14 18:22:04 -04:00
#
# zim_update - update the zim repository
#
cd ${ZIM_HOME}
2016-05-14 18:22:04 -04:00
# this is the cleanest way I know how to update a repository
2016-05-14 18:22:04 -04:00
git remote update -p
git merge --ff-only @\{u\}
# and update the submodules
git submodule update --init --recursive
2018-06-12 08:44:00 -04:00
# 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
echo "\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 "No such module \"${zmodule}\", run \"zmanage install\" to install missing modules" >&2
fi
done