File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 55# Usage:
66# ./scripts/build-from-source.sh
77#
8- # Options (via environment variables:
9- # OUTPUT_DIR - Full path of directory to place built binaries (optional, default: $(pwd)/ bin)
8+ # Options (via environment variables) :
9+ # OUTPUT_DIR - Full path of directory to place built binaries (optional, default: repo's root bin directory )
1010#
1111
12- set -e
12+ set -euo pipefail
1313
1414# Default values
1515BINARY_NAME=" hypeman-api"
@@ -41,14 +41,13 @@ command -v make >/dev/null 2>&1 || error "make is required but not installed"
4141SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
4242SOURCE_DIR=" $( cd " ${SCRIPT_DIR} /.." && pwd) "
4343
44- if [ -z " $OUTPUT_DIR " ]; then
45- OUTPUT_DIR=${SOURCE_DIR} /bin
46- fi
44+ : " ${OUTPUT_DIR:= ${SOURCE_DIR} / bin} "
4745
4846# Create output directory if it doesn't exist
4947mkdir -p " $OUTPUT_DIR "
5048
5149BUILD_LOG=" ${OUTPUT_DIR} /build.log"
50+ : > " $BUILD_LOG "
5251
5352# =============================================================================
5453# Build from source
Original file line number Diff line number Diff line change @@ -211,6 +211,11 @@ if [ -n "$BINARY_DIR" ]; then
211211
212212 # Copy binaries to TMP_DIR
213213 info " Copying binaries from ${BINARY_DIR} ..."
214+
215+ for f in " ${BINARY_NAME} " " hypeman-token" " .env.example" ; do
216+ [ -f " ${BINARY_DIR} /${f} " ] || error " File ${f} not found in ${BINARY_DIR} "
217+ done
218+
214219 cp " ${BINARY_DIR} /${BINARY_NAME} " " ${TMP_DIR} /${BINARY_NAME} "
215220 cp " ${BINARY_DIR} /hypeman-token" " ${TMP_DIR} /hypeman-token"
216221 cp " ${BINARY_DIR} /.env.example" " ${TMP_DIR} /.env.example"
You can’t perform that action at this time.
0 commit comments