Skip to content

Commit 4423cbf

Browse files
mlafeldtMaxxen
authored andcommitted
Make upgrade.sh portable
1 parent f631fc6 commit 4423cbf

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

upgrade.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
if sed --version 2>/dev/null | grep -q GNU; then
4+
SED_INPLACE="sed -i"
5+
else
6+
SED_INPLACE="sed -i ''"
7+
fi
8+
39
## How to run
410
## `./upgrade.sh`
511

@@ -22,5 +28,10 @@ fi
2228

2329
echo "Start to upgrade from $duckdb_rs_version to $duckdb_version"
2430

25-
sed -i '' "s/$duckdb_rs_version/$duckdb_version/g" Cargo.toml crates/libduckdb-sys/upgrade.sh crates/libduckdb-sys/Cargo.toml .github/workflows/rust.yaml
26-
./crates/libduckdb-sys/upgrade.sh
31+
$SED_INPLACE "s/$duckdb_rs_version/$duckdb_version/g" \
32+
Cargo.toml \
33+
crates/libduckdb-sys/upgrade.sh \
34+
crates/libduckdb-sys/Cargo.toml \
35+
.github/workflows/rust.yaml
36+
37+
exec ./crates/libduckdb-sys/upgrade.sh

0 commit comments

Comments
 (0)