Skip to content

Commit

Permalink
Capture output of Go compilation in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
acook committed Mar 10, 2024
1 parent d5b3752 commit 1471e7e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/build_test.bash
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/usr/bin/env bash

source "$(dirname ${BASH_SOURCE[0]})/_shared.bash"
source "$(dirname "${BASH_SOURCE[0]}")/_shared.bash"

timestamp="$(date --utc "+%Y.%m.%d")"
shortsha="$(git rev-parse --short HEAD)"
blacklight="$BLROOT/bin/blacklight_$timestamp-$shortsha"

warn " -- building blacklight binary..."
go build -o "$blacklight" "$BLROOT/src/"*.go
exitstatus=$?

if [[ -x $blacklight ]]; then
warn " -- binary built: $(basename $blacklight)"
if [[ $exitstatus == 0 && -x $blacklight ]]; then
warn " -- binary built: $(basename "$blacklight")"

file "$blacklight" >&2
ls -sh "$blacklight" >&2
Expand All @@ -19,7 +20,8 @@ if [[ -x $blacklight ]]; then
echo "$blacklight"
else
warn " -- something went wrong!"
warn " -- go exit status: $exitstatus"
warn " -- binary not found at: \"$blacklight\""
exit -1
exit 255
fi

0 comments on commit 1471e7e

Please sign in to comment.