Make sed cross-platform

This commit is contained in:
Wilson Lin 2020-01-26 16:47:06 +13:00
parent 88b593b352
commit 4a7f57e792
2 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,8 @@ if [ -f Cargo.toml.orig ]; then
echo 'Not altering Java Cargo.toml file'
else
cp Cargo.toml Cargo.toml.orig
sed -i 's%^hyperbuild = .*$%hyperbuild = { path = ".." }%' Cargo.toml
# Don't use -i as macOS requires '' argument but then Ubuntu will treat as pattern.
sed 's%^hyperbuild = .*$%hyperbuild = { path = ".." }%' Cargo.toml.orig > Cargo.toml
fi
cargo build $rust_build_arg
mv Cargo.toml.orig Cargo.toml

View File

@ -16,7 +16,8 @@ if [ -f native/Cargo.toml.orig ]; then
echo 'Not altering Node.js Cargo.toml file'
else
cp native/Cargo.toml native/Cargo.toml.orig
sed -i '' 's%^hyperbuild = .*$%hyperbuild = { path = "../.." }%' native/Cargo.toml
# Don't use -i as macOS requires '' argument but then Ubuntu will treat as pattern.
sed 's%^hyperbuild = .*$%hyperbuild = { path = "../.." }%' native/Cargo.toml.orig > native/Cargo.toml
fi
npx neon build --release
mv native/Cargo.toml.orig native/Cargo.toml