prettified update and install script output

This commit is contained in:
Jakob Guddas 2018-06-12 18:27:54 +02:00
parent b62b482989
commit 84e1488db5
2 changed files with 8 additions and 4 deletions

View File

@ -6,7 +6,7 @@ mkdir -p ${ZIM_HOME}/modules
for zmodule in ${zmodules}; do for zmodule in ${zmodules}; do
dir=$ZIM_HOME/modules/${${${zmodule%/}%.git}##*/} dir=$ZIM_HOME/modules/${${${zmodule%/}%.git}##*/}
if [ -d ${dir} ]; then if [ -d ${dir} ]; then
print "${zmodule} is already installed" print "\n${zmodule} module is already installed"
else else
arr=("${(@s|/|)${zmodule%/}}") arr=("${(@s|/|)${zmodule%/}}")
if [ ${#arr} = 1 ]; then if [ ${#arr} = 1 ]; then
@ -16,7 +16,9 @@ for zmodule in ${zmodules}; do
else else
repo=${zmodule} repo=${zmodule}
fi fi
print "\nInstalling ${zmodule} module"
GIT_ASKPASS=/bin/echo git clone --recursive ${repo} ${dir} 2> /dev/null \ GIT_ASKPASS=/bin/echo git clone --recursive ${repo} ${dir} 2> /dev/null \
&& print "${zmodule} got installed" || print "${repo} could not be installed" || print "${repo} module could not be installed"
fi fi
done done
print

View File

@ -2,6 +2,7 @@
# zim_update - update the zim repository # zim_update - update the zim repository
# #
echo "\nUpdating Zim"
cd ${ZIM_HOME} cd ${ZIM_HOME}
# this is the cleanest way I know how to update a repository # this is the cleanest way I know how to update a repository
@ -18,7 +19,7 @@ for zmodule in ${zmodules}; do
dir=${${${zmodule%/}%.git}##*/} dir=${${${zmodule%/}%.git}##*/}
if [ -d ${ZIM_HOME}/modules/${dir} ]; then if [ -d ${ZIM_HOME}/modules/${dir} ]; then
echo "\nUpdating ${zmodule} module." print "\nUpdating ${zmodule} module"
cd ${ZIM_HOME}/modules/${dir} cd ${ZIM_HOME}/modules/${dir}
# update the modules repository # update the modules repository
@ -29,6 +30,7 @@ for zmodule in ${zmodules}; do
git submodule update --init --recursive git submodule update --init --recursive
else else
print "No such module \"${zmodule}\", run \"zmanage install\" to install missing modules" >&2 print "\nNo such module \"${zmodule}\", run \"zmanage install\" to install missing modules" >&2
fi fi
done done
print