Skip to content

Commit d760ca9

Browse files
author
Cody Cutler
committed
let user select lab submission part
1 parent 877431d commit d760ca9

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

GNUmakefile

+18-2
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ git-handin: handin-check
222222
WEBSUB = https://ccutler.scripts.mit.edu/6.828/handin.py
223223

224224
handin: tarball-pref myapi.key
225-
@curl -f -F file=@lab$(LAB)-handin.tar.gz -F key=\<myapi.key $(WEBSUB)/upload \
225+
@SUF=$(LAB); \
226+
test -f .suf && SUF=`cat .suf`; \
227+
curl -f -F file=@lab$$SUF-handin.tar.gz -F key=\<myapi.key $(WEBSUB)/upload \
226228
> /dev/null || { \
227229
echo ; \
228230
echo Submit seems to have failed.; \
@@ -254,7 +256,21 @@ tarball: handin-check
254256
git archive --format=tar HEAD | gzip > lab$(LAB)-handin.tar.gz
255257

256258
tarball-pref: handin-check
257-
git archive --prefix=lab$(LAB)/ --format=tar HEAD | gzip > lab$(LAB)-handin.tar.gz
259+
@SUF=$(LAB); \
260+
if test $(LAB) -eq 3 -o $(LAB) -eq 4; then \
261+
read -p "Which part would you like to submit? [a, b, c (lab 4 only)]" p; \
262+
if test "$$p" != a -a "$$p" != b; then \
263+
if test ! $(LAB) -eq 4 -o ! "$$p" = c; then \
264+
echo "Bad part \"$$p\""; \
265+
exit 1; \
266+
fi; \
267+
fi; \
268+
SUF="$(LAB)$$p"; \
269+
echo $$SUF > .suf; \
270+
else \
271+
rm -f .suf; \
272+
fi; \
273+
git archive --prefix=lab$(LAB)/ --format=tar HEAD | gzip > lab$$SUF-handin.tar.gz
258274

259275
myapi.key:
260276
@echo Get an API key for yourself by visiting $(WEBSUB)

0 commit comments

Comments
 (0)