Skip to content

Commit

Permalink
Add a check for absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisb committed Dec 16, 2024
1 parent 00c8ae1 commit 5ff987a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contrib/validation/validate_lethe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5ff987a

Please sign in to comment.