From c896c86123acd581256fb10c52be0d449f84acd2 Mon Sep 17 00:00:00 2001 From: Miguel Fonseca Date: Sat, 10 Jun 2023 11:14:59 +0300 Subject: [PATCH] Ensure script is run from root directory --- bin/list-experimental-api-matches.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/list-experimental-api-matches.sh b/bin/list-experimental-api-matches.sh index 273615b4bcc695..9dd25adffcb193 100755 --- a/bin/list-experimental-api-matches.sh +++ b/bin/list-experimental-api-matches.sh @@ -1,5 +1,12 @@ #!/bin/sh +# Exit if any command fails. +set -e + +# Change to the root directory. +cd "$(dirname "$0")" +cd .. + # POSIX: prefer standard grep over rg. Git is assumed present (ls-files), but # could be replaced with find. grep_experimental_apis() {