mirror of https://github.com/01-edu/public.git
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:
parent
73a9b4660a
commit
76e4a02339
|
@ -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}"
|
||||
|
|
|
@ -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…
Reference in New Issue