Skip to content

Commit

Permalink
Prevent garbage toml-e files on macOS
Browse files Browse the repository at this point in the history
Newer macOS versions output `uname` as "Darwin", while older
versions output "darwin".
  • Loading branch information
roderickvd committed Oct 15, 2024
1 parent 1d80a40 commit 09e4c3e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ cd $WORKINGDIR

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

OS=`uname`
function replace_in_file() {
if [ "$OS" == 'darwin' ]; then
# for MacOS
sed -i '' -e "$1" "$2"
else
# for Linux and Windows
sed -i'' -e "$1" "$2"
fi
OS=`uname`
shopt -s nocasematch
case "$OS" in
darwin)
# for macOS
sed -i '' -e "$1" "$2"
;;
*)
# for Linux and Windows
sed -i'' -e "$1" "$2"
;;
esac
}

function switchBranch {
Expand Down

0 comments on commit 09e4c3e

Please sign in to comment.