diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2024-05-27 10:57:51 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2024-05-27 10:57:51 -0300 |
commit | bbb9f04eecc66a9e8e208cc4abc0466697807765 (patch) | |
tree | 3132a7e0d0d2023733d91532263bb3be4e545d18 | |
parent | e3f4e53320cb1da93fb7c25bce0129314a79a812 (diff) |
More POSIX-related clean ups
-rwxr-xr-x | build.sh | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/build.sh b/build.sh index 1a9a1ec..9b78d8c 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ do_build() { mkdir -p out/lua/cratera/ || exit 1 mkdir -p out/bin || exit 1 # worst tool for this job - cp -R src/cratera/* out/lua/cratera/ || exit 1 + cp -R src/cratera out/lua/ || exit 1 if [ "$ENV_WRAPPER" = '' ]; then printf "#!%s\n" "$LUA_INTERPRETER" >out/bin/cratera || exit 1 else @@ -26,7 +26,6 @@ do_build() { do_test() { # FIXME this does NOT handle LUA_PATH correctly. # FIXME nor LUA_INIT. - do_build || exit 1 mkdir -p out/test || exit 2 # these tests use the regular lua interpreter LUA_PATH='./out/lua/?.lua;./out/lua/?/init.lua;;' "$LUA_INTERPRETER" test/testp.lua || exit 2 @@ -38,23 +37,26 @@ do_test() { case "$1" in -h|--help|help) - echo 'The Cratera "Build System"' - echo 'To build, use './build.sh build'. Files will be put in out/.' - echo 'To run tests, use './build.sh test'.' - echo 'The currently selected Lua interpreter is:' - printf ' LUA_INTERPRETER=%s' "$LUA_INTERPRETER" - echo '' - echo 'The currently selected env wrapper is:' - printf ' ENV_WRAPPER=%s' "$ENV_WRAPPER" - echo '' + printf '%s\n' \ + 'The Cratera "Build System"' \ + 'To build, use '\''./build.sh build'\''. Files will be put in '\''out/'\''.' \ + 'To run tests, use '\''./build.sh test'\''.' \ + 'The currently selected Lua interpreter is:' \ + "$(printf ' LUA_INTERPRETER=%s' "$LUA_INTERPRETER")" \ + 'The currently selected env wrapper is:' \ + "$(printf ' ENV_WRAPPER=%s' "$ENV_WRAPPER")" + ;; + test-only) + do_test ;; test) - do_test || exit $? + do_build + do_test ;; build|'') - do_build || exit $? + do_build ;; *) - echo 'sorry' + printf '%s\n' 'sorry' ;; esac |