mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-24 17:35:01 +01:00
lazy.sh: various fixes (#372)
- Emit warning and return 1 when no cmd is specified - get docdep requirements from lazy.sh parent dir, not $GOPATH/src/zrepl/zrepl - Explicitly warn when gopath is not in PATH - Fix `release` cmd - replace `! -z` with `-n` Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
This commit is contained in:
parent
c44dccc34b
commit
d6799e08d8
20
lazy.sh
20
lazy.sh
@ -20,11 +20,14 @@ if ! type go >/dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$GOPATH" ]; then
|
if [ -z "$GOPATH" ]; then
|
||||||
step "Make sure you have your GOPATH configured correctly" 1>&2
|
step "Your GOPATH is not configured correctly" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CHECKOUTPATH="${GOPATH}/src/github.com/zrepl/zrepl"
|
if ! (echo "$PATH" | grep "${GOPATH}/bin" > /dev/null); then
|
||||||
|
step "GOPATH/bin is not in your PATH (it should be towards the start of it)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
godep() {
|
godep() {
|
||||||
step "install build dependencies (versions pinned in build/go.mod and build/tools.go)"
|
step "install build dependencies (versions pinned in build/go.mod and build/tools.go)"
|
||||||
@ -51,8 +54,9 @@ docdep() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
step "Installing doc build dependencies"
|
step "Installing doc build dependencies"
|
||||||
local reqpath="${CHECKOUTPATH}/docs/requirements.txt"
|
# shellcheck disable=SC2155
|
||||||
if [ ! -z "$ZREPL_LAZY_DOCS_REQPATH" ]; then
|
local reqpath="$(dirname "${BASH_SOURCE[0]}")/docs/requirements.txt"
|
||||||
|
if [ -n "$ZREPL_LAZY_DOCS_REQPATH" ]; then
|
||||||
reqpath="$ZREPL_LAZY_DOCS_REQPATH"
|
reqpath="$ZREPL_LAZY_DOCS_REQPATH"
|
||||||
fi
|
fi
|
||||||
pip3 install -r "$reqpath"
|
pip3 install -r "$reqpath"
|
||||||
@ -63,9 +67,15 @@ release() {
|
|||||||
make release
|
make release
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# shellcheck disable=SC2198
|
||||||
|
if [ -z "$@" ]; then
|
||||||
|
step "No command specified, exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
for cmd in "$@"; do
|
for cmd in "$@"; do
|
||||||
case "$cmd" in
|
case "$cmd" in
|
||||||
godep|docdep|release_bins|docs)
|
godep|docdep|release|docs)
|
||||||
eval $cmd
|
eval $cmd
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user