Skip to content

Commit 80838d1

Browse files
authored
Merge pull request InfiniTimeOrg#178 from petterhs/docker
check for cmake build-success before running post-build.sh
2 parents 0a237a7 + a028c39 commit 80838d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docker/build.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ main() {
3131

3232
CmakeGenerate
3333
CmakeBuild $target
34-
35-
if [[ "$DISABLE_POSTBUILD" != "true" ]]; then
34+
BUILD_RESULT=$?
35+
if [ "$DISABLE_POSTBUILD" != "true" -a "$BUILD_RESULT" == 0 ]; then
3636
source "$BUILD_DIR/post_build.sh"
3737
fi
3838
}
@@ -70,7 +70,9 @@ CmakeGenerate() {
7070
CmakeBuild() {
7171
local target="$1"
7272
[[ -n "$target" ]] && target="--target $target"
73-
cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc)
73+
if cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc)
74+
then return 0; else return 1;
75+
fi
7476
}
7577

7678
[[ $SOURCED == "false" ]] && main "$@" || echo "Sourced!"

0 commit comments

Comments
 (0)