Skip to content
Snippets Groups Projects
Commit 457b4e2b authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

importexp: improved handling of directory structure

parent 1960182d
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,10 @@ WORK_DIR=$(mktemp -d)
for RUN_SCRIPT
do
RUN_SCRIPT_BASE=$(basename $RUN_SCRIPT)
RUN_SCRIPT_BASE=${RUN_SCRIPT_BASE#exp.}
RUN_SCRIPT_BASE=${RUN_SCRIPT_BASE%.*}
RUN_BASE_DIR=$(dirname $RUN_SCRIPT)
case "$RUN_BASE_DIR" in
/*) ;;
......@@ -54,8 +58,12 @@ do
./*) RUN_BASE_DIR=$PWD${RUN_BASE_DIR#.} ;;
esac
RUN_BASE_DIR=${RUN_BASE_DIR%/$CUSTOM_SUBDIR}
MODEL_BASE_DIR=${BUILD_DIR:-${RUN_BASE_DIR%/run}}
MODEL_BASE_DIR=${BUILD_DIR:-$RUN_BASE_DIR}
MODEL_BASE_DIR=${MODEL_BASE_DIR%/scripts}
MODEL_BASE_DIR=${MODEL_BASE_DIR%/$RUN_SCRIPT_BASE}
MODEL_BASE_DIR=${MODEL_BASE_DIR%/experiments}
MODEL_BASE_DIR=${MODEL_BASE_DIR%/run}
MODEL_BASE_DIR=${MODEL_BASE_DIR%/$BUILD_SUBDIR}
echo "Analyzing '$RUN_SCRIPT'" >&2
......@@ -104,6 +112,7 @@ done\
s:^(\s*)(set\s+\+x\s*$|(set\s+\+\w+)x):\1\3:
'"${REMOVE_ERROR_FLAG_SH-}"'
s:^(\s*)SCRIPT_DIR=.*$:\1SCRIPT_DIR='$WORK_DIR':
s:^(\s*)experiments_dir=.*$:\1experiments_dir='$WORK_DIR':
s:^(\s*)BUILD_DIR=.*$:\1BUILD_DIR='$MODEL_BASE_DIR/$BUILD_SUBDIR':
s:^(\s*)EXPDIR=.*$:\1EXPDIR='$WORK_DIR':
s:^(\s*\.\s+)\./:\1'$RUN_BASE_DIR'/:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment