Skip to content

Commit af07d45

Browse files
committed
fix sed command on macOS
1 parent 8026dad commit af07d45

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/bench.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ jobs:
5353
cp target/${{matrix.target}}/release/examples/blogpost-compress .
5454
cp target/${{matrix.target}}/release/examples/blogpost-uncompress .
5555
# switch the C implementation from zlib-ng to zlib-chromium
56-
sed -i '/^libz-sys =/c\libz-sys = { git = "https://github.com/folkertdev/libz-chromium-sys", rev = "4671e8e16bf277d06ff2397e3091db3515c6f934", default-features = false, features = ["zlib-ng"] }' Cargo.toml
56+
# sed on macOS is a bit annoying
57+
if sed --version 2>/dev/null | grep -q GNU; then
58+
sed -i '/^libz-sys =/c\libz-sys = { git = "https://github.com/folkertdev/libz-chromium-sys", rev = "4671e8e16bf277d06ff2397e3091db3515c6f934", default-features = false, features = ["zlib-ng"] }' Cargo.toml
59+
else
60+
printf '%s\n' '/^libz-sys =/c\' 'libz-sys = { git = "https://github.com/folkertdev/libz-chromium-sys", rev = "4671e8e16bf277d06ff2397e3091db3515c6f934", default-features = false, features = ["zlib-ng"] }' | sed -i '' -f - Cargo.toml
61+
fi
5762
cargo build --target ${{matrix.target}} -p test-libz-rs-sys --release --examples
5863
cp target/${{matrix.target}}/release/examples/blogpost-compress blogpost-compress-chromium
5964
cp target/${{matrix.target}}/release/examples/blogpost-uncompress blogpost-uncompress-chromium

0 commit comments

Comments
 (0)