diff --git a/bootstrap.sh b/bootstrap.sh index 1fd9393..055272b 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,6 +1,14 @@ #!/usr/bin/env zsh # vi: set expandtab ft=zsh tw=80 ts=2 +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 cloneMacOSSystemRepo() { local repoUrl="${MACOS_SYSTEM_REPO_URL:-https://github.com/astzweig/macos-system.git}" git clone -q "${repoUrl}" . @@ -24,6 +32,7 @@ function main() { pushd -q "${tmpdir}" cloneMacOSSystemRepo cloneZSHLibRepo + ensureDocopts sudo "${tmpdir}/install.sh" "$@" popd -q } diff --git a/install.sh b/install.sh index 65bd57f..2a6cb96 100755 --- a/install.sh +++ b/install.sh @@ -1,14 +1,6 @@ #!/usr/bin/env zsh # vi: set expandtab ft=zsh tw=80 ts=2 -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() { export ASTZWEIG_ZSHLIB=${_DIR}/zshlib FPATH="${ASTZWEIG_ZSHLIB}:${FPATH}" @@ -260,7 +252,6 @@ function checkPrerequisites() { } function main() { - ensureDocopts autoloadZShLib checkPrerequisites || return eval "`docopts -f -V - -h - : "$@" <<- USAGE