Created
September 6, 2018 12:05
-
-
Save tansaku/8cb9d393ccc80fd3a55ba82015208ada to your computer and use it in GitHub Desktop.
first attempt at codio autograding script
This file contains hidden or 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
#!/bin/bash | |
cd /home/codio/workspace/hw-ruby-intro | |
sudo apt-add-repository -y ppa:rael-gc/rvm | |
sudo apt-get update | |
sudo apt-get install rvm | |
source /usr/share/rvm/scripts/rvm | |
rvm use 2.4.0 | |
gem install bundler | |
bundle | |
# rspec | |
OUTPUT1=("$(bundle exec rspec spec/part1_spec.rb)") | |
# echo "$OUTPUT1" | |
# if [ $? -ne 0 ]; then exit 1; fi | |
if echo "$OUTPUT1" | grep -q "12 examples, 0 failures" | |
then | |
echo "<h1>you rule</h1>" | |
exit 0 | |
else | |
echo "<h1>you suck</h1>" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment