2023-04-17 12:01:41 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-08-22 10:32:05 +00:00
|
|
|
# Extract the relative path from the plugin root to this script directory.
|
|
|
|
# By doing so, we can run this script from anywhere.
|
2023-04-17 12:01:41 +00:00
|
|
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2023-08-22 10:32:05 +00:00
|
|
|
head_dir=$(cd "$(dirname "$script_dir")" && cd ../../.. && pwd)
|
|
|
|
relative_path=${script_dir#$head_dir/}
|
2023-04-17 12:01:41 +00:00
|
|
|
|
2023-08-22 10:32:05 +00:00
|
|
|
# Run the main script in the container for better performance.
|
2023-09-01 09:07:55 +00:00
|
|
|
wp-env run tests-cli -- bash wp-content/plugins/$relative_path/scripts/index.sh
|