forked from exetico/custom-sonos-card
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
create-dist-maxi-media-player.sh
30 lines (27 loc) · 1016 Bytes
/
create-dist-maxi-media-player.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
DIR="dist-maxi-media-player"
FILE="maxi-media-player.js"
mkdir -p $DIR
# Use gsed on Mac
if [[ "$OSTYPE" == "darwin"* ]]; then
alias sed=gsed
fi
cp dist/custom-sonos-card.js $DIR/$FILE
cd $DIR || exit
sed -i 's/"sonos-card"/"maxi-media-player"/g' $FILE
sed -i 's/"Sonos"/"Maxi Media Player"/g' $FILE
sed -i 's/sonos-card-/mxmp-/g' $FILE
sed -i 's/sonos-/mxmp-/g' $FILE
sed -i 's/sonos-card-dispatch/mxmp-dispatch/g' $FILE
sed -i 's/Sonos Card/Maxi Media Player/g' $FILE
sed -i 's/Media player for your Sonos speakers/Media card for Home Assistant UI with a focus on managing multiple media players/g' $FILE
FILE="README.md"
cd ..
cp $FILE $DIR/
cd $DIR || exit
sed -i '/\/\/#ONLY_SONOS_CARD_START/,/\/\/#ONLY_SONOS_CARD_END/d' $FILE
sed -i ':a;N;$!ba;s/[^\n]*#ONLY_SONOS_CARD[^\n]*\n//g' $FILE
sed -i 's/custom-sonos-card/maxi-media-player/g' $FILE
sed -i 's/custom:sonos-card/custom:maxi-media-player/g' $FILE
sed -i 's/Sonos Card/Maxi Media Player/g' $FILE
sed -i 's/sonos-/mxmp-/g' $FILE