Browse Source

refactor(code-editor): add CODE_EDITOR_ONLY_RUN to test images, allowing to run code in the code editor if enabled

pull/2137/head
lee 9 months ago committed by LEEDASILVA
parent
commit
76e4a02339
  1. 5
      js/tests/entrypoint.sh
  2. 10
      sh/tests/entrypoint.sh

5
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}"

10
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

Loading…
Cancel
Save