Fix sed on linux
This commit is contained in:
parent
f0a35bfa31
commit
20914afd17
1 changed files with 11 additions and 2 deletions
|
|
@ -24,6 +24,15 @@ else
|
||||||
echo "Your working directory is clean."
|
echo "Your working directory is clean."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# GNU sed takes the suffix as part of -i, BSD sed requires a separate argument
|
||||||
|
sed_inplace() {
|
||||||
|
if sed --version >/dev/null 2>&1; then
|
||||||
|
sed -i "$@"
|
||||||
|
else
|
||||||
|
sed -i '' "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
echo "Bumping versions"
|
echo "Bumping versions"
|
||||||
|
|
||||||
which cargo-set-version || cargo install cargo-edit
|
which cargo-set-version || cargo install cargo-edit
|
||||||
|
|
@ -39,8 +48,8 @@ npm install
|
||||||
|
|
||||||
NEWVER=$(grep '^version = ' ../Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
NEWVER=$(grep '^version = ' ../Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
||||||
cd ../reconcile-python
|
cd ../reconcile-python
|
||||||
sed -i '' "s/^version = \".*\"/version = \"$NEWVER\"/" Cargo.toml
|
sed_inplace "s/^version = \".*\"/version = \"$NEWVER\"/" Cargo.toml
|
||||||
sed -i '' "s/^version = \".*\"/version = \"$NEWVER\"/" pyproject.toml
|
sed_inplace "s/^version = \".*\"/version = \"$NEWVER\"/" pyproject.toml
|
||||||
cargo update --workspace
|
cargo update --workspace
|
||||||
uv lock
|
uv lock
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue