Ensure doctops in bootstrap.sh

This commit is contained in:
Rezart Qelibari
2022-02-16 19:36:51 +01:00
parent 2f7f58b2c2
commit efe91a17b8
2 changed files with 9 additions and 9 deletions

View File

@@ -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
}

View File

@@ -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