diff --git a/js/tests/entrypoint.sh b/js/tests/entrypoint.sh index 4765ca61a..415374ccd 100755 --- a/js/tests/entrypoint.sh +++ b/js/tests/entrypoint.sh @@ -2,4 +2,9 @@ set -e +if test "$CODE_EDITOR_RUN_ONLY" = true; then + node "./${EXERCISE}.sh" "$@" + exit +fi + node /app/test.mjs "/jail/student" "${EXERCISE}" diff --git a/sh/tests/entrypoint.sh b/sh/tests/entrypoint.sh index 5bede087a..ade91742a 100755 --- a/sh/tests/entrypoint.sh +++ b/sh/tests/entrypoint.sh @@ -6,6 +6,16 @@ cp -r /app . cp -a student app cd app +if test "$CODE_EDITOR_RUN_ONLY" = true; then + if test -f "./${EXERCISE}.sh"; then + chmod +x "./${EXERCISE}.sh" + fi + + # run shell programs on the code editor + bash "./${EXERCISE}.sh" "$@" + exit +fi + if test -f "./student/${EXERCISE}.sh"; then chmod +x "./student/${EXERCISE}.sh" fi