From: Brendan Hansen Date: Fri, 8 Dec 2023 01:54:44 +0000 (-0600) Subject: changed build.sh to error if it fails X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=0b8a95ee1d1fee1f50a608530eaa094f3d25d628;p=onyx.git changed build.sh to error if it fails --- diff --git a/build.sh b/build.sh index 871e42bb..5abcb168 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + DIST_DIR="./dist" compile_all() { @@ -38,20 +40,22 @@ package_all() { cp ./scripts/onyx-pkg.onyx "$DIST_DIR/tools" cp ./scripts/default.json "$DIST_DIR/tools/pkg_templates" - echo "Installing runtime library" - mkdir -p "$DIST_DIR/lib" - mkdir -p "$DIST_DIR/include" - - case "$(uname)" in - Linux) suffix='so' ;; - *BSD) suffix='so' ;; - Darwin) suffix='dylib' ;; - *) suffix='dll' ;; - esac - - [ -f runtime/onyx_runtime.$suffix ] && cp runtime/onyx_runtime.$suffix "$DIST_DIR/lib/" - cp "shared/include/onyx_library.h" "$DIST_DIR/include/onyx_library.h" - cp "shared/include/wasm.h" "$DIST_DIR/include/wasm.h" + if [ ! -z ${ONYX_RUNTIME_LIBRARY+x} ]; then + echo "Installing runtime library" + mkdir -p "$DIST_DIR/lib" + mkdir -p "$DIST_DIR/include" + + case "$(uname)" in + Linux) suffix='so' ;; + *BSD) suffix='so' ;; + Darwin) suffix='dylib' ;; + *) suffix='dll' ;; + esac + + [ -f runtime/onyx_runtime.$suffix ] && cp runtime/onyx_runtime.$suffix "$DIST_DIR/lib/" + cp "shared/include/onyx_library.h" "$DIST_DIR/include/onyx_library.h" + cp "shared/include/wasm.h" "$DIST_DIR/include/wasm.h" + fi cp -r "tests" "$DIST_DIR/" cp -r "examples" "$DIST_DIR/" @@ -61,6 +65,7 @@ package_all() { cp misc/onyx-windows.sublime-build "$DIST_DIR/misc" cp misc/onyx-mode.el "$DIST_DIR/misc" cp misc/onyx.sublime-syntax "$DIST_DIR/misc" + cp misc/onyx.tmPreferences "$DIST_DIR/misc" cp misc/vscode/onyxlang-0.1.9.vsix "$DIST_DIR/misc" cp LICENSE "$DIST_DIR/LICENSE"