#!/bin/bash
#
# Change the Build and Source directory in ./DartConfiguration.tcl to the current directory and the one above respectively
#
# ctest_fix_path

set -e

CURRENT_DIR=`pwd`
# echo ${CURRENT_DIR}

# Note use vertical bar as the replacement (CURRENT_DIR) has slashes in it and confuses the sed command
sed -i "s|^\(SourceDirectory: \s*\).*$|\1$CURRENT_DIR/..|" ./DartConfiguration.tcl
sed -i "s|^\(BuildDirectory: \s*\).*\$|\1${CURRENT_DIR}|" ./DartConfiguration.tcl
