Last active
December 5, 2020 16:24
-
-
Save robwilkerson/6bdac9e3d464c65d6bdee13393f53c24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
# execute as ./grade.sh | |
# Assumes homework submission was downloaded to your Desktop as <homework_id>.zip | |
# Unzips to ./<homework_id> | |
# rsync's to homeworkgrading.com | |
# opens an ssh connection to homeworkgrading.com in the terminal window | |
# launches VSCode | |
# Move the downloaded zip to the evaluating directory | |
download=$(find ~/Desktop -regex '.*/[0-9]\{6,\}\.zip') | |
zip=$(basename "$download") | |
homework=${zip%.*} | |
echo "Download: $download" | |
echo "Zip: $zip" | |
echo "Homework: $homework" | |
mv "$download" . | |
echo "unzipping..." | |
unzip "$zip" -d "$homework" | |
echo "syncing..." | |
rsync -av --no-perms "./$homework" homeworkgrading.com:~ | |
code "./$homework" & | |
ssh -t homeworkgrading.com "cd ~/$homework ; bash" | |
rm "./$zip" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment