github-merge-pr: correctly reference .config from script directory
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 29 Apr 2024 21:27:15 +0000 (23:27 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 29 Apr 2024 21:27:15 +0000 (23:27 +0200)
Currently the script reference the .config from the current directory
instead of using the directory where the script is located.

Use dirname $0 to correctly reference the .config in the script
directory instead of the current directory where the script is executed.

Fixes: a598bb477585 ("github-merge-pr: move script config to separate file")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
github-merge-pr.sh

index 16a661d2fb4fb28406ddb825e651be2015f526aa..cce2586df3a9634b8e81d14886a69d1ea1fa0d48 100755 (executable)
@@ -30,7 +30,7 @@ GITHUB_REPO_OWNER="openwrt"
 # GITHUB_USE_SSH=1
 
 # Everything in .config will overwrite the default values set up
-[ -f  .config ] && source .config
+[ -f "$(dirname $0)/.config" ] && source $(dirname $0)/.config
 
 PRID="$1"
 BRANCH="${2:-main}"