diff options
-rwxr-xr-x | automated/lib/sh-test-lib | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib index 9030899..299964d 100755 --- a/automated/lib/sh-test-lib +++ b/automated/lib/sh-test-lib @@ -326,3 +326,12 @@ add_repo() { ;; esac } + +create_out_dir() { + [ -z "$1" ] && error_msg "Usage: create_out_dir output_dir" + OUTPUT=$1 + [ -d "${OUTPUT}" ] && + mv "${OUTPUT}" "${OUTPUT}_$(date -r "${OUTPUT}" +%Y%m%d%H%M%S)" + mkdir -p "${OUTPUT}" + [ -d "${OUTPUT}" ] || error_msg "Could not create output directory ${OUTPUT}" +} |