Autoload zshlib functions
This commit is contained in:
17
install.sh
17
install.sh
@@ -1,6 +1,23 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
function ensureDocopts() {
|
||||
which docopts > /dev/null
|
||||
[ $? -eq 0 ] && return
|
||||
curl --output ./docopts -fsSL https://github.com/astzweig/docopts/releases/download/v.0.7.0/docopts_darwin_amd64
|
||||
chmod u+x ./docopts
|
||||
PATH="`pwd`:${PATH}"
|
||||
}
|
||||
|
||||
function autoloadZShLib() {
|
||||
FPATH="`pwd`/zshlib:${FPATH}"
|
||||
local funcNames=("${(@f)$(find ./zshlib -type f -perm +u=x | awk -F/ '{ print $NF }')}")
|
||||
autoload -Uz "${funcNames[@]}"
|
||||
}
|
||||
|
||||
function main() {
|
||||
ensureDocopts
|
||||
autoloadZShLib
|
||||
hio debug "Current working dir is: `pwd`"
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
Reference in New Issue
Block a user