diff --git a/fugit.sh b/fugit.sh new file mode 100755 index 0000000000000000000000000000000000000000..9305e7c18c5469ddf1359458508624276a66c37c --- /dev/null +++ b/fugit.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ $# -lt 2 ] || ([ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]); then + printf "Usage: %s <repository name> <branch>\n" $(basename $0) >&2 + printf "Supply a repository name and branch name\n" >&2 + printf "Execute within the directory containing 'grades.csv'\n" >&2 + exit 1 +fi + +repo_name="$1" +branch="$2" + +for user in *; do + if [ -d "$user" ]; then + cd "$user" + + current_dir=$(basename "$PWD") + + zedat_username=`echo $current_dir | sed 's/.*(\([a-z0-9]*\))$/\1/'` + + if [ ! -d npvp-exercises ]; then + git clone "git@git.imp.fu-berlin.de:$zedat_username/$repo_name" + fi + + git -C "$repo_name" checkout "$branch" + cd .. + fi +done diff --git a/install.sh b/install.sh index 4df6257bad017a2a37fd1362f47c97c97873dc6f..9939e73ff33d2bd668519fb51797db2cdfda7296 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #! /bin/sh -scripts="fixpdf.sh fucopy.sh fufixpdf.sh fuzip.sh fuxournalexport.sh fixtimes.sh fuclean.sh" +scripts="fixpdf.sh fucopy.sh fufixpdf.sh fuzip.sh fuxournalexport.sh fufixtimes.sh fuclean.sh fugit.sh" destdir="${DESTDIR:=$HOME/.local/bin}" mkdir -p "$destdir"