From 137a1cf53a3bcf4e95aece2d942071e35c1fcddc Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" <137705289+trbernstein@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:38:23 +0200 Subject: [PATCH] Install zshlib even if given as a compiled file --- modules/08-install-zsh-libraries.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/08-install-zsh-libraries.sh b/modules/08-install-zsh-libraries.sh index fbf81f9..fb37a1a 100755 --- a/modules/08-install-zsh-libraries.sh +++ b/modules/08-install-zsh-libraries.sh @@ -6,11 +6,15 @@ function addLibToStartupFile() { function installZshlib() { local zshlibPath=${libDir}/astzweig_zshlib - pushd -q ${ASTZWEIG_ZSHLIB} - zcompile -z -U ${zshlibPath} $(find . -type f -perm +u=x -maxdepth 1) - libs+=(${zshlibPath}.zwc) + if [[ -d ${ASTZWEIG_ZSHLIB} ]]; then + pushd -q ${ASTZWEIG_ZSHLIB} + zcompile -z -U ${zshlibPath} $(find . -type f -perm +u=x -maxdepth 1) + libs+=(${zshlibPath}.zwc) + popd -q + elif [[ -f ${ASTZWEIG_ZSHLIB} ]]; then + cp ${ASTZWEIG_ZSHLIB} ${zshlibPath}.zwc; + fi chmod ugo=r ${zshlibPath}.zwc - popd -q } function modifyGlobalFpath() { @@ -46,9 +50,9 @@ function getUsage() { Usage: $cmdName show-questions [ ]... $cmdName [-v] [-d FILE] - + Install convenient zsh libraries system-wide for use in zsh scripts. - + Options: -d FILE, --logfile FILE Print log message to logfile instead of stdout. -v, --verbose Be more verbose.