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

This commit is contained in:
lee 2023-08-11 15:38:54 +01:00 committed by LEEDASILVA
parent 73a9b4660a
commit 76e4a02339
2 changed files with 15 additions and 0 deletions

View File

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

View File

@ -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