From 91f0972df5ab196d39e20a6a3f67b023aea7c4f8 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 2 May 2024 14:26:40 +0200 Subject: [PATCH] github-merge-pr: fix loading .config if symbolic link is used Fix loading of .config is symbolic link is used to reference the github-merge-pr.sh script. Signed-off-by: Christian Marangi --- github-merge-pr.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/github-merge-pr.sh b/github-merge-pr.sh index cce2586..dd08a89 100755 --- a/github-merge-pr.sh +++ b/github-merge-pr.sh @@ -29,8 +29,11 @@ GITHUB_REPO_OWNER="openwrt" # Set this line in .config to use SSH key to rebase PR branch # GITHUB_USE_SSH=1 +SCRIPT_DIR="$(dirname $0)" +[ -h $0 ] && SCRIPT_DIR="$(dirname $(readlink $0))" + # Everything in .config will overwrite the default values set up -[ -f "$(dirname $0)/.config" ] && source $(dirname $0)/.config +[ -f "$SCRIPT_DIR/.config" ] && source "$SCRIPT_DIR"/.config PRID="$1" BRANCH="${2:-main}" -- 2.30.2