From b0d4f7254e11e12e2a9810a0c26b08c8233913d0 Mon Sep 17 00:00:00 2001 From: unset Date: Mon, 18 Nov 2024 01:36:42 +0100 Subject: [PATCH] make further changes to the build script --- build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 077e25a..756d52f 100755 --- a/build.sh +++ b/build.sh @@ -26,7 +26,7 @@ args_win86-64() args_emscripten() { ARCHITECTURE="web" - COMPILER="/home/user/.local/bin/emcc" + COMPILER="emcc" # just make sure it's in $PATH (it's a pain to install) ARGS="-s USE_SDL=2" FILE_EXSTENSION=".html" } @@ -46,7 +46,7 @@ fi # make (and clear) the build directory -mkdir "$BUILD_DIR $BUILD_DIR/$ARCHITECTURE" +mkdir -p "$BUILD_DIR/$ARCHITECTURE" rm -rf "${BUILD_DIR:?}/$ARCHITECTURE/*" # copy included files or directories to the build directory @@ -58,8 +58,8 @@ fi EXE_PATH=$BUILD_DIR/$ARCHITECTURE/$PROJECT_NAME$FILE_EXSTENSION echo "building at: $EXE_PATH" -# check whether the compiler path contains an executable at said path -if [ ! -x "$COMPILER" ]; then +# check whether the compiler can actually be executed +if [ ! -x "$COMPILER" ] && ! command -v "$COMPILER" > /dev/null; then echo -e "\033[91mCouldn't find an executable at path: \033[0m $COMPILER" exit 1 fi