From 239a98a67ad4ee789c9645fb1a1df7b9887568ea Mon Sep 17 00:00:00 2001 From: Pierre Prinetti Date: Wed, 23 Mar 2022 09:46:05 +0100 Subject: [PATCH] Only read the first matching config line In case there are duplicates, only pick one. --- go-setversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-setversion b/go-setversion index 0d50a71..9d7074d 100755 --- a/go-setversion +++ b/go-setversion @@ -84,7 +84,7 @@ go_from_config() { while [ "$target" != '/' ]; do target="$(dirname "$target")" - version="$(sed -n "s|${target} ||p" "$config_file")" + version="$(sed -n "0,\|${target} |s|${target} ||p" "$config_file")" if [ -n "$version" ]; then printf "%s" "$version" return