Skip to content

Commit 4b214af

Browse files
committed
fix(build): broken npm run build detection
1 parent 12017e2 commit 4b214af

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

live-demo/deploy/buildRelease.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
# write npm run output both to console and to build.log
55
npm run build 2>&1 | tee build.log
6+
build_status=${PIPESTATUS[0]}
67

78
# if exist status from the npm run build is not 0
89
# then exit with the status code from the npm run build
9-
if [ ${PIPESTATUS[0]} -ne 0 ]; then
10-
echo "Build failed. Exiting with status code ${PIPESTATUS[0]}"
11-
exit ${PIPESTATUS[0]}
10+
if [ $build_status -ne 0 ]; then
11+
echo "Build failed. Exiting with status code $build_status"
12+
exit $build_status
1213
fi

0 commit comments

Comments
 (0)