mirror of https://github.com/01-edu/public.git
Xavier Petit
4 years ago
committed by
xpetit
2 changed files with 23 additions and 8 deletions
@ -1,15 +1,30 @@ |
|||||||
#!/bin/sh |
#!/usr/bin/env bash |
||||||
|
|
||||||
set -o errexit |
# Unofficial Bash Strict Mode |
||||||
set -o pipefail |
set -euo pipefail |
||||||
IFS=' |
IFS=' |
||||||
' |
' |
||||||
|
|
||||||
cp -rT /app /jail |
mkdir student |
||||||
cd /jail |
cd student |
||||||
|
|
||||||
|
if test "$REPOSITORY"; then |
||||||
|
password=$(cat) |
||||||
|
if ! git clone --depth=1 --shallow-submodules http://root:"${password}"@"$REPOSITORY" . 2>/dev/null; then |
||||||
|
echo Could not clone your repository |
||||||
|
exit 1 |
||||||
|
fi |
||||||
|
else |
||||||
|
first_file=$(echo "$EXPECTED_FILES" | cut -d' ' -f1) |
||||||
|
mkdir "$(dirname $first_file)" |
||||||
|
cat > "$first_file" |
||||||
|
fi |
||||||
|
|
||||||
|
cd |
||||||
|
cp -rT /app . |
||||||
|
|
||||||
if ! test -f ${EXERCISE}_test.sh; then |
if ! test -f ${EXERCISE}_test.sh; then |
||||||
echo No test file found for the exercise : "$EXERCISE" |
echo No test file found for the exercise : "$EXERCISE" |
||||||
exit 1 |
exit 1 |
||||||
fi |
fi |
||||||
sh ${EXERCISE}_test.sh |
bash ${EXERCISE}_test.sh |
||||||
echo PASS |
|
||||||
|
Loading…
Reference in new issue