Skip to content

Commit 8874e0c

Browse files
committed
chore(examples): use absolute path
The `run-all` script used relative paths, which only work if the script is executed from the project root directory. This commit ensures that the script can be run from anywhere. Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent e6a4cfe commit 8874e0c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

examples/run-all

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
set -o errexit # Exit on error
44
set -o nounset # Treat unset variables as an error
55

6+
EXAMPLES_DIR=$(cd -- "$(dirname "$0")" && pwd)
7+
68
usage() {
79
echo "Usage: $0 [command]"
810
echo
@@ -59,20 +61,20 @@ main() {
5961
fi
6062

6163
declare -a examples=(
62-
examples/e2e
63-
examples/graphql
64-
examples/jest
65-
examples/messages
66-
examples/mocha
67-
examples/serverless
68-
examples/typescript
69-
examples/v3/e2e
70-
examples/v3/provider-state-injected
71-
examples/v3/run-specific-verifications
72-
examples/v3/todo-consumer
73-
examples/v3/typescript
74-
examples/v4/matchers
75-
examples/v4/plugins
64+
"$EXAMPLES_DIR/e2e"
65+
"$EXAMPLES_DIR/graphql"
66+
"$EXAMPLES_DIR/jest"
67+
"$EXAMPLES_DIR/messages"
68+
"$EXAMPLES_DIR/mocha"
69+
"$EXAMPLES_DIR/serverless"
70+
"$EXAMPLES_DIR/typescript"
71+
"$EXAMPLES_DIR/v3/e2e"
72+
"$EXAMPLES_DIR/v3/provider-state-injected"
73+
"$EXAMPLES_DIR/v3/run-specific-verifications"
74+
"$EXAMPLES_DIR/v3/todo-consumer"
75+
"$EXAMPLES_DIR/v3/typescript"
76+
"$EXAMPLES_DIR/v4/matchers"
77+
"$EXAMPLES_DIR/v4/plugins"
7678
)
7779

7880
if [ $# -gt 0 ]; then

0 commit comments

Comments
 (0)