Skip to content

Commit

Permalink
sed -i requires the option without a space before on Linux (macOS is …
Browse files Browse the repository at this point in the history
…fine also)
  • Loading branch information
gildas committed Oct 26, 2023
1 parent d1eb2e8 commit 7bc412d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions hooks/common/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function update_chart_version() { # {{{2
local version=$2

verbose "Updating Chart: ${file##*/} to ${version}"
sed -Ei .bak "/^version:/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
sed -Ei.bak "/^version:/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
status=$?
if (( status )); then
error "Failed to update ${file##*/}, exit code: $status"
Expand All @@ -126,7 +126,7 @@ function update_chart_appversion() { # {{{2
local status

verbose "Updating App Version: ${file##*/} to ${version}"
sed -Ei .bak "/^appVersion:/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
sed -Ei.bak "/^appVersion:/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
status=$?
if (( status )); then
error "Failed to update ${file##*/}, exit code: $status"
Expand All @@ -145,7 +145,7 @@ function update_dockerfile_version() { # {{{2
local status

verbose "Updating: ${file##*/} to ${version}"
sed -Ei .bak \
sed -Ei.bak \
-e "/^LABEL\s+org\.opencontainers\.image\.version/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" \
-e "/^LABEL\s+org\.opencontainers\.image\.created/s/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z/$(date -u +%Y-%m-%dT%H:%M:%SZ)/" \
"$file"
Expand All @@ -165,7 +165,7 @@ function update_appveyor_version() { # {{{2
local status

verbose "Updating: ${file##*/} to ${version}"
sed -Ei .bak \
sed -Ei.bak \
-e "/^version:/s/.*/version: ${version}+{build}/" \
"$file"
status=$?
Expand Down
2 changes: 1 addition & 1 deletion hooks/go/functions-lang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function update_version_file() { # {{{2
local status

verbose "Updating: ${file##*/} to ${version}"
sed -Ei .bak "/^var[ ]+VERSION[ ]*=/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
sed -Ei.bak "/^var[ ]+VERSION[ ]*=/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
status=$?
if (( status )); then
error "Failed to update ${file##*/}, exit code: $status"
Expand Down
2 changes: 1 addition & 1 deletion hooks/node/functions-lang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function update_version_file() { # {{{2
local status

verbose "Updating: ${file##*/} to ${version}"
sed -Ei .bak "/^[ \t]*\"version\":[ \t]*\"/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
sed -Ei.bak "/^[ \t]*\"version\":[ \t]*\"/s/[0-9]+\.[0-9]+\.[0-9]+/${version}/" "$file"
status=$?
if (( status )); then
error "Failed to update ${file##*/}, exit code: $status"
Expand Down

0 comments on commit 7bc412d

Please sign in to comment.