ed9d08a091
to autoloads the functions and sources the scripts, instead of executing zimfw during startup, and having it always figuring out what do to on the fly. This takes out the worry about zimfw interfering with the startup time, and allows room to add more features to it. So, zstyle was replaced by a custom zmodule function to define the modules, with the extra ability of allowing users to set custom fpath paths, autoloaded functions and sourced scripts per module.
21 lines
584 B
Plaintext
21 lines
584 B
Plaintext
# This runs in a new shell
|
|
readonly MODULE=${1}
|
|
readonly DIR=${2}
|
|
readonly URL=${3}
|
|
readonly REV=${5}
|
|
readonly -i QUIET=${6}
|
|
readonly CLEAR_LINE=$'\E[2K\r'
|
|
if [[ -e ${DIR} ]]; then
|
|
# Already exists
|
|
return 0
|
|
fi
|
|
(( ! QUIET )) && print -Rn ${CLEAR_LINE}"Installing ${MODULE} …"
|
|
if ERR=$(command git clone -b ${REV} -q --recursive ${URL} ${DIR} 2>&1); then
|
|
if (( ! QUIET )); then
|
|
print -PR ${CLEAR_LINE}"%F{green}✓%f %B${MODULE}:%b Installed"
|
|
fi
|
|
else
|
|
print -u2 -PR ${CLEAR_LINE}"%F{red}✗ %B${MODULE}:%b Error during git clone%f"$'\n'${(F):- ${(f)^ERR}}
|
|
return 1
|
|
fi
|