From 079f2dad25f792118676ddc2dc0bb8278617e080 Mon Sep 17 00:00:00 2001 From: Ben Elferink Date: Wed, 4 Dec 2024 20:21:41 +0200 Subject: [PATCH] Fix script directory (#1917) --- frontend/webapp/cypress/.gitignore | 1 + tests/common/odigos_ui.sh | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 frontend/webapp/cypress/.gitignore diff --git a/frontend/webapp/cypress/.gitignore b/frontend/webapp/cypress/.gitignore new file mode 100644 index 000000000..04ddc8bcb --- /dev/null +++ b/frontend/webapp/cypress/.gitignore @@ -0,0 +1 @@ +screenshots/* \ No newline at end of file diff --git a/tests/common/odigos_ui.sh b/tests/common/odigos_ui.sh index aea9a8519..45192205d 100755 --- a/tests/common/odigos_ui.sh +++ b/tests/common/odigos_ui.sh @@ -3,7 +3,10 @@ # Ensure the script fails if any command fails set -e -scripts_dir="/tests/common" +scripts_dir="$(cd "$(dirname "$0")" && pwd)" +# The above "$scripts_dir" key is used to identify where the script was called from, to ensure all paths are relative to the script. +# This is useful when the script is called from another location, and the paths are relative to the calling script (for exmaple YAML file). + log_filename="$scripts_dir/odigos_ui.log" back_pid_filename="$scripts_dir/ui_backend.pid" front_pid_filename="$scripts_dir/ui_frontend.pid" @@ -116,7 +119,7 @@ function test() { # This method prevents duplicated code across multiple-scripts function main() { if [ $# -lt 1 ]; then - echo "❌ Error: Incorrect usage - '$0 [arguments...]'" + echo "❌ Error: Incorrect usage - '$0 '" exit 1 fi