Skip to content

Commit 93d7086

Browse files
committed
Short circuit scripts with some helpful messages
1 parent 0ff4707 commit 93d7086

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

build-python

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
#!/usr/bin/env bash
22

33
set -o errexit
4-
set -o xtrace
54

6-
[[ $INSTALL_DEST ]]
7-
[[ $VERSION ]]
5+
if [[ ! $INSTALL_DEST ]] ; then
6+
echo 'Missing INSTALL_DEST'
7+
exit 1
8+
fi
9+
10+
if [[ ! $VERSION ]] ; then
11+
echo 'Missing $VERSION'
12+
exit 1
13+
fi
14+
15+
set -o xtrace
816

917
sudo env PYTHON_BUILD_ROOT=/opt/pyenv/plugins/python-build \
1018
/opt/pyenv/plugins/python-build/bin/python-build $VERSION $INSTALL_DEST/$VERSION

create-archive

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
#!/usr/bin/env bash
22

33
set -o errexit
4-
set -o xtrace
54

6-
[[ $LSB_RELEASE ]]
7-
[[ $INSTALL_DEST ]]
8-
[[ $VERSION ]]
5+
if [[ ! $LSB_RELEASE ]] ; then
6+
echo 'Missing LSB_RELEASE'
7+
exit 1
8+
fi
9+
10+
if [[ ! $INSTALL_DEST ]] ; then
11+
echo 'Missing INSTALL_DEST'
12+
exit 1
13+
fi
14+
15+
if [[ ! $VERSION ]] ; then
16+
echo 'Missing VERSION'
17+
exit 1
18+
fi
19+
20+
set -o xtrace
921

1022
: ${TAR_PATHS:=}
1123
: ${DEST:=${1}}

0 commit comments

Comments
 (0)