Skip to content

Instantly share code, notes, and snippets.

@robwilkerson
Last active December 5, 2020 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwilkerson/6bdac9e3d464c65d6bdee13393f53c24 to your computer and use it in GitHub Desktop.
Save robwilkerson/6bdac9e3d464c65d6bdee13393f53c24 to your computer and use it in GitHub Desktop.
#/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