Skip to content

Commit

Permalink
refactor(code-editor): add CODE_EDITOR_ONLY_RUN to test images, allow…
Browse files Browse the repository at this point in the history
…ing to run code in the code editor if enabled
  • Loading branch information
LEEDASILVA committed Aug 11, 2023
1 parent 63cdee7 commit 2493fc9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 10 additions & 0 deletions sh/tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2493fc9

Please sign in to comment.