Skip to content

Commit

Permalink
Handle wolframscript segmentation faults on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
rhennigan committed Oct 15, 2022
1 parent 67af9a8 commit fcd3ef7
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/main.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
#!/bin/bash

set -e

export SCRIPT_DIR=$(dirname ${0})

wolfram_script () {
wolframscript -script "${1}"
WS_EXIT_CODE=$(echo $?)
case $WS_EXIT_CODE in
0)
;;
139)
echo "::warning::Warning: wolframscript did not exit cleanly"
;;
*)
exit $WS_EXIT_CODE
;;
esac
}

echo "::group::Installing dependencies..."
wolframscript ${SCRIPT_DIR}/install_dependencies.wls
wolfram_script "${SCRIPT_DIR}/install_dependencies.wls"
echo "::endgroup::"

echo "::group::Building Paclet..."
wolframscript ${SCRIPT_DIR}/build_paclet.wls
wolfram_script "${SCRIPT_DIR}/build_paclet.wls"
echo "::endgroup::"

0 comments on commit fcd3ef7

Please sign in to comment.