#!/bin/bash # make sure the tag for the generated files is correct # by checking that all changes have been commited to GIT # (this does not include newly created files) if ( ! git diff-index --quiet --cached HEAD -- ) || ( ! git diff-files --quiet ) then echo "Uncommitted changes in the GIT repository:" git status --untracked-files=no read -p "Add changes and commit, amend last commit or exit [c/a/e]: " res case $res in [Cc]* ) git commit -a;; [Aa]* ) git commit -a --amend;; * ) exit;; esac fi CURRENT_VERSION=`git describe --tags --long` CONTINUE_VERSION=${1:-$CURRENT_VERSION} if [ ! -f "runs/e2-estia_$CONTINUE_VERSION.run" ]; then # get describe from previous version echo "No run for revision $CONTINUE_VERSION, try to use previous version" PREV_ID=`git log -n 2 --oneline --pretty=format:"%h" | tail -1` CONTINUE_VERSION=`git describe --tags --long $PREV_ID` fi sbatch cbatch.tsh $CURRENT_VERSION $CONTINUE_VERSION # waiting for batch job to start and send all output directly to terminal sleep 2 tail -qf tmp/stdout.log tmp/stderr.log