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
dir=$ZIM_HOME/modules/${${${zmodule%/}%.git}##*/}
if [ -d ${dir} ]; then
print "${zmodule} is already installed"
print "\n${zmodule} module is already installed"
else
arr=("${(@s|/|)${zmodule%/}}")
if [ ${#arr} = 1 ]; then
@ -16,7 +16,9 @@ for zmodule in ${zmodules}; do
else
repo=${zmodule}
fi
print "\nInstalling ${zmodule} module"
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
done
print

View File

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