Skip to content

Commit 9edcc82

Browse files
updated build.sh; increments cache version
1 parent 8297cb0 commit 9edcc82

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

build.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rm -f mobile.js
1717
# precompiled libs
1818
cat jquery* iscroll.js >> mobile.js
1919

20-
export VERSION="`git rev-parse --short HEAD`"
20+
VERSION="`git rev-parse --short HEAD`"
2121

2222
# compile the rest
2323
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge chasecar.lib.js | sed "s/{VER}/$VERSION/" >> mobile.js
@@ -27,4 +27,15 @@ java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimization
2727

2828
cd ..
2929
echo "Done!"
30+
echo -n "Increment cache version... "
31+
32+
CACHE_VERSION=`grep "# version" cache.manifest | grep -Po "\d+"`
33+
CACHE_VERSION=`expr $CACHE_VERSION + 1`
34+
mv cache.manifest cache.manifest.tmp
35+
sed "s/^\(# version\) [0-9]\+/\1 $CACHE_VERSION/" cache.manifest.tmp > cache.manifest
36+
rm -f cache.manifest.tmp
37+
38+
echo "Done!"
39+
40+
echo "Cache version: $CACHE_VERSION"
3041
echo "Build version: $VERSION"

cache.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# version 35
2+
# version 37
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg

js/tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ function addPosition(position) {
729729
if(dt != 0) {
730730
rate = (position.gps_alt - vehicle.curr_position.gps_alt) / dt;
731731
vehicle.ascent_rate = 0.7 * rate
732-
+ 0.3 * vehicles[vehicle_index].ascent_rate;
732+
+ 0.3 * vehicle.ascent_rate;
733733

734734
// if vehicle is not a car, record altitude
735735
if(vehicle.vehicle_type != "car") {

0 commit comments

Comments
 (0)