From 5ff987ae0d7e5c72717b0194392b7d295f8c5461 Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Mon, 16 Dec 2024 08:08:15 -0500 Subject: [PATCH] Add a check for absolute path --- contrib/validation/validate_lethe.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/validation/validate_lethe.sh b/contrib/validation/validate_lethe.sh index f6860129cc..d60324939e 100644 --- a/contrib/validation/validate_lethe.sh +++ b/contrib/validation/validate_lethe.sh @@ -36,7 +36,7 @@ show_help() { echo echo "Options:" echo " -h, --help Display this help message" - echo " -o, --output Specify the output directory for validation results" + echo " -o, --output Specify the absolute path directory for validation results" echo echo "Description:" echo "This script automates the validation of the Computational Fluid Dynamics (CFD)" @@ -121,6 +121,11 @@ if [[ -z $output_path ]]; then exit 1 fi +if [[ "$output_path" != /* ]]; then + echo "Error: The path '$output_path' is not an absolute path." >&2 + exit 1 +fi + echo "The output path has been set to $output_path" verify_or_create_folder "$output_path" lethe_path=$(pwd)