Skip to content

Commit 21538c6

Browse files
committed
Address pr comments
1 parent b3d6d8e commit 21538c6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

scripts/build-from-source.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
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
1515
BINARY_NAME="hypeman-api"
@@ -41,14 +41,13 @@ command -v make >/dev/null 2>&1 || error "make is required but not installed"
4141
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4242
SOURCE_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
4947
mkdir -p "$OUTPUT_DIR"
5048

5149
BUILD_LOG="${OUTPUT_DIR}/build.log"
50+
: > "$BUILD_LOG"
5251

5352
# =============================================================================
5453
# Build from source

scripts/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)