forked from LMS-Community/plugin-Qobuz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·45 lines (33 loc) · 1022 Bytes
/
build.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
echo Preparing build...
if [ -e Qobuz ]; then
rm -rf Qobuz/*
else
mkdir Qobuz
fi
rm -f repo.xml*
cp * Qobuz/ &> /dev/null
cp -R HTML lib Qobuz/
rm -f Qobuz/*.zip Qobuz/*.sh* Qobuz/*.js Qobuz/.DS_store Qobuz/lib/.DS_store Qobuz/lib/Text/.DS_store
VERSION=`grep -o -E "version>(.*)</ver" install.xml | grep -o -E "[0-9]\.[0-9]+"`
ZIPFILE=Qobuz-$VERSION.zip
echo Packing files...
zip -9vr $ZIPFILE Qobuz -x *.sh* *.zip
echo ""
echo Creating repository file...
rm -rf Qobuz/
SHA=`shasum $ZIPFILE`
wget --no-check-certificate -q http://www.pierrebeck.fr/SqueezeboxQobuz/repo.xml
if [ -e repo.xml ]; then
# create updated repo.xml file
cp -f repo.xml repo.xml.bak
SHA=`echo "$SHA" | awk {'print $1'}`
cat repo.xml | sed -e "s/sha>.*</sha>$SHA</g" | sed -e "s/\(version=\"\)[^\"]*\(\" .*\)/\1$VERSION\2/g" | sed -e "s/Qobuz-.*zip/$ZIPFILE/" > repo.new
mv -f repo.new repo.xml
echo ""
cat repo.xml
echo $ZIPFILE and an updated repo.xml have been created. Please upload.
else
echo $SHA
fi
echo ""