Skip to content

Commit

Permalink
fix: specify portable sed arguments (#1332)
Browse files Browse the repository at this point in the history
  • Loading branch information
kriswuollett authored Nov 1, 2023
1 parent ed97a1b commit e265d24
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ docker run --rm \
--output /output/resource.rs \
--parameters conventions=resource

SED=(sed -i)
if [[ "$(uname)" = "Darwin" ]]; then
SED=(sed -i "")
fi

# Keep `SCHEMA_URL` key in sync with spec version
sed -i "s/\(opentelemetry.io\/schemas\/\)[^\"]*\"/\1$SPEC_VERSION\"/" src/lib.rs
"${SED[@]}" "s/\(opentelemetry.io\/schemas\/\)[^\"]*\"/\1$SPEC_VERSION\"/" src/lib.rs

# handle doc generation failures
sed -i 's/\[2\]\.$//' src/resource.rs # remove trailing [2] from few of the doc comments
"${SED[@]}" 's/\[2\]\.$//' src/resource.rs # remove trailing [2] from few of the doc comments

cargo fmt

0 comments on commit e265d24

Please sign in to comment.