#!/bin/bash if [ -z "$2" ] then echo " Copies Anduril testcase results to the original source location. Use it when testcases fail, but you know the results to be correct. After copying you must commit the changes in the checkout. Usage: testcasecopy executionfolder/ComponentFolder /path/to/bundle/root example: testcasecopy results/CSVJoin ~/anduril/trunk/microarray/ Any extra arguments are given to the copy command: cp -a [args] source target Recommended use: -i for prompt before overwrite and -v for verbose " exit 0 fi IFS=$'\n' component=$( basename "$1" ) execfolder=$( dirname "$1" ) source=$1 bundle=$2 shift 2 if [ ! -d "$source" ] then echo "$source folder not found" exit 1 fi if [ ! -d "$bundle" ] then echo "$bundle folder not found" exit 1 fi #echo $execfolder $component cases=$( find "$source" -mindepth 1 -maxdepth 1 -type d ) for case in $cases do casebase=$( basename "$case" ) tgt="${bundle}/components/${component}/testcases/${casebase}/expected-output" if [ -d "$tgt" ] then for output in $( ls "${case}/component" | grep -v ^_ ) do cp -a $@ "${case}/component/${output}" "${tgt}/" done else echo "$component $casebase does not have expected-output folder" fi done