Skip to content

Instantly share code, notes, and snippets.

@petrblaho
Created January 7, 2016 09:15
Show Gist options
  • Save petrblaho/c2b16d56f117b46b0ac8 to your computer and use it in GitHub Desktop.
Save petrblaho/c2b16d56f117b46b0ac8 to your computer and use it in GitHub Desktop.
#!/usr/bin/sh
studentdir=$1
declare -a commands=(
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb"
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb Jiří"
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb Jiri"
"faketime 2015-10-13 bundle exec ruby kolikjeste.rb Renáta"
"faketime 2016-02-10 bundle exec ruby kolikjeste.rb Petr"
"faketime 2015-06-10 bundle exec ruby kolikjeste.rb Petr"
"faketime 2015-06-10 bundle exec ruby kolikjeste.rb Pavel"
"faketime 2016-02-10 bundle exec ruby kolikjeste.rb Horymír"
"faketime 2016-03-10 bundle exec ruby kolikjeste.rb Horymír"
)
testit() {
exec >> "$1"_notes.txt
exec 2>&1
echo "$1"
pushd $1 &>/dev/null
bundle
for com in "${commands[@]}"
do
echo $com
$com
# bundle exec ruby kolikjeste.rb $value
echo '-'
done
echo 'rubocop'
bundle exec rubocop
popd &>/dev/null
echo
echo '================================================================================'
echo
}
if test -z "$studentdir"; then
for dir in `find . -maxdepth 1 ! -path . -type d`
do
testit "$dir"
done
else
testit "$studentdir"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment