Skip to content

Commit

Permalink
Only read the first matching config line
Browse files Browse the repository at this point in the history
In case there are duplicates, only pick one.
  • Loading branch information
pierreprinetti committed Mar 23, 2022
1 parent 476b3c8 commit 239a98a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go-setversion
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 239a98a

Please sign in to comment.