Skip to content

Commit 8111dc9

Browse files
committed
Complain on non-existing exercises
1 parent 17272fc commit 8111dc9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ docker: all
3131
rm -rf dockersite && cp -r site dockersite
3232
for f in `find dockersite -name '*setup.sh'`; do echo "Changing location of shtrl-check in $$f"; sed -i 's|usr/lib/shutorial/bin|shutorial/bin|' $$f; chmod +rx $$f; done
3333
cp distros/Docker/shutorial.sh dockersite/
34-
docker build -t shutorial -f distros/Docker/Dockerfile dockersite
34+
docker build -t mquinson/shutorial -f distros/Docker/Dockerfile dockersite
3535
rm -rf dockersite
36-
# chmod +x shutorial
3736

3837
install:
3938
@echo "XX make install"

distros/Docker/shutorial.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ login)
1313
# log into the docker
1414
exec bash
1515
;;
16-
list)
16+
list|ls)
1717
echo "Here is the list of existing exercises:"
1818
sed 's/^/ /' /usr/share/shutorial/usage/exercises.list
1919
echo
@@ -35,6 +35,12 @@ run)
3535

3636
user=$(id -un)
3737

38+
if [ ! -e "/usr/share/shutorial/usage/$exo/" ]; then
39+
echo "There is no exercise $exo in the list. To see the current list, simply type:"
40+
echo " shutorial list"
41+
exit 1
42+
fi
43+
3844
echo "Launching exercice $exo"
3945

4046
# Tell the user what to do on login

0 commit comments

Comments
 (0)