Skip to content

Commit f653b59

Browse files
authored
Merge pull request #231 from prometheus-lua/fix/release-automation
fix script path in prometheus-lua
2 parents fdb83e3 + 3caf431 commit f653b59

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

prometheus-lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
#!/usr/bin/env sh
22
set -eu
33

4-
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
4+
SCRIPT_PATH="$0"
5+
while [ -L "$SCRIPT_PATH" ]; do
6+
LINK_TARGET="$(readlink "$SCRIPT_PATH")"
7+
case "$LINK_TARGET" in
8+
/*) SCRIPT_PATH="$LINK_TARGET" ;;
9+
*) SCRIPT_PATH="$(dirname "$SCRIPT_PATH")/$LINK_TARGET" ;;
10+
esac
11+
done
12+
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$SCRIPT_PATH")" && pwd)
513
BUNDLED_LUA="$SCRIPT_DIR/runtime/lua"
614

715
: "${PROMETHEUS_LUA_VERSION:=dev}"

0 commit comments

Comments
 (0)