-
Notifications
You must be signed in to change notification settings - Fork 0
/
live-push
executable file
·63 lines (53 loc) · 1.39 KB
/
live-push
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
#
# Replace xxVER and xxDATE
#
VERSION=1.90
DATE=2023-01-14
TMPDIR=/tmp/prestosidebarclock-$DATE-$VERSION-$$
TAG=live_push_$DATE
FILES=$(cat MANIFEST)
# =====
echo Checking javascript files and minifying...
make -C common
# =====
# Compute this now before we change directories, buy only display at the
# end
MODIFIED=$(hg status $FILES | wc -l)
# =====
#echo Checking CSS files...
#grep \.css MANIFEST | xargs -L1 csslint
# if [ $? -ne 0 ]; then
# echo Correct CSS errors and commit before proceeding
# exit 1
#fi
# =====
echo Copying source directory to temp directory
cp -a . $TMPDIR
cd $TMPDIR
# =====
echo Setting version and date in files
#for file in gadget.xml gadget.html settings.html common/gadget.all.min.js; do
# perl -pi -e "s/xxVER/$VERSION/g; s/xxDATE/$DATE/g; s/gadget.all.js/gadget.all.min.js/g;" $file
#done
for file in gadget.xml gadget.html settings.html common/gadget.all.js; do
perl -pi -e "s/xxVER/$VERSION/g; s/xxDATE/$DATE/g;" $file
done
# =====
echo Creating final zip/gadget file
TMPDIR=$(mktemp -d)
ZIP=prestosidebarclock-$VERSION.gadget
7z a -tzip $TMPDIR/$ZIP $FILES
# =====
PWD=$(pwd)
mv -f $TMPDIR/$ZIP ~
echo Final gadget is at: ~/$ZIP
#
# Check if any diffs need to be committed. If so, warn user
#
#MODIFIED=$(hg status $FILES | wc -l) # see above
if [ $MODIFIED -ne 0 ]; then
echo WARNING - Uncommitted changes exist
hg status $FILES
exit 1
fi