1
0
Fork 0
mirror of synced 2024-05-25 11:31:14 -04:00
zimfw/tools/zim_install
2018-06-12 18:27:54 +02:00

25 lines
734 B
Plaintext

# Source user configuration
[[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc
# Install Modules
mkdir -p ${ZIM_HOME}/modules
for zmodule in ${zmodules}; do
dir=$ZIM_HOME/modules/${${${zmodule%/}%.git}##*/}
if [ -d ${dir} ]; then
print "\n${zmodule} module is already installed"
else
arr=("${(@s|/|)${zmodule%/}}")
if [ ${#arr} = 1 ]; then
repo="https://github.com/zimfw/${zmodule}"
elif [ ${#arr} = 2 ]; then
repo="https://github.com/${zmodule}"
else
repo=${zmodule}
fi
print "\nInstalling ${zmodule} module"
GIT_ASKPASS=/bin/echo git clone --recursive ${repo} ${dir} 2> /dev/null \
|| print "${repo} module could not be installed"
fi
done
print