Skip to content

Commit

Permalink
Accept custom directories in the bump script.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdmanv committed Sep 15, 2020
1 parent b89aa8e commit 9d8cf12
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build/bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ usage() {
}

main() {
local prev=${1:?"$(usage)"}
local next=${2:?"$(usage)"}
local -a pkgs=(docker/ scripts/ examples/ pkg/ helm/)
local prev=${1:?"$(usage)"}; shift
local next=${1:?"$(usage)"}; shift
if [ "$#" -eq 0 ]; then
pkgs=( docker/ scripts/ examples/ pkg/ helm/ )
else
pkgs=( "$@" )
fi
grep -E "${prev}" -r "${pkgs[@]}" | cut -d ':' -f 1 | uniq | xargs sed -ri "s/${prev}/${next//./\\.}/g"
}

Expand Down

0 comments on commit 9d8cf12

Please sign in to comment.