Skip to content

Commit 09e4c3e

Browse files
committed
Prevent garbage toml-e files on macOS
Newer macOS versions output `uname` as "Darwin", while older versions output "darwin".
1 parent 1d80a40 commit 09e4c3e

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

publish.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ cd $WORKINGDIR
88

99
crates=( "protocol" "oauth" "core" "discovery" "audio" "metadata" "playback" "connect" "librespot" )
1010

11-
OS=`uname`
1211
function replace_in_file() {
13-
if [ "$OS" == 'darwin' ]; then
14-
# for MacOS
15-
sed -i '' -e "$1" "$2"
16-
else
17-
# for Linux and Windows
18-
sed -i'' -e "$1" "$2"
19-
fi
12+
OS=`uname`
13+
shopt -s nocasematch
14+
case "$OS" in
15+
darwin)
16+
# for macOS
17+
sed -i '' -e "$1" "$2"
18+
;;
19+
*)
20+
# for Linux and Windows
21+
sed -i'' -e "$1" "$2"
22+
;;
23+
esac
2024
}
2125

2226
function switchBranch {

0 commit comments

Comments
 (0)