Skip to content
Snippets Groups Projects
Commit a8eb38e5 authored by jie's avatar jie
Browse files

added hust adaptions

parent 858c5d67
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,9 @@ clean: ...@@ -11,6 +11,9 @@ clean:
submit: clean submit: clean
git gc git gc
STUID=$(STUID) STUNAME=$(STUNAME) bash -c "$$(curl -s http://moon.nju.edu.cn/people/yyjiang/teach/submit.sh)" STUID=$(STUID) STUNAME=$(STUNAME) bash submit.sh
setup:
STUID=$(STUID) STUNAME=$(STUNAME) bash setup.sh
.PHONY: default clean submit .PHONY: default clean submit
setup.sh 0 → 100644
set -e
[ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit
[ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit
echo "uploading public key..."
curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" https://dssl.cun.io/teach/api/uploads/pasetup
sleep 2
echo "setup git-remote..."
git remote add hustpa pa@dssl.cun.io:${STUID}-git
git branch pa0
git branch pa1
git branch pa2
git branch pa3
git push hustpa pa0
git push hustpa pa1
git push hustpa pa2
git push hustpa pa3
git branch -u hustpa/pa0 pa0
git branch -u hustpa/pa1 pa1
git branch -u hustpa/pa2 pa2
git branch -u hustpa/pa3 pa3
echo "done!"
set -e
[ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit
[ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit
echo -n "The task to be submitted > "
read task
cwd=${PWD##*/}
echo "${STUID} (${STUNAME}) submitting ${task}..."
wiki='https://dssl.cun.io/teach/api/uploads/'
tarball=$(mktemp -q).tar.bz2
bash -c "cd .. && tar cj ${cwd} > ${tarball}"
curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment