installation fix: all it build if .git is not present, #194
Costa Tsaousis (ktsaou) committed
Apr 7, 2016 at 12:30 UTC
11163aa2e0cb0fc11b4f029cc8daa743de348265
2 files changed
+15
-7
web/Makefile.am
+3
-1
@@ -97,8 +97,10 @@ version.txt:
97
rm -f v.tmp; \
98
else \
99
rm -f v.tmp; \
100
- false; \
100
+ echo "0" > version.txt; \
101
fi; \
102
+ else \
103
+ echo "0" > version.txt; \
104
fi
105
106
.PHONY: version.txt
web/index.html
+12
-6
@@ -1623,10 +1623,16 @@ function getNetdataVersion(callback) {
1623
cache: false
1624
})
1625
.done(function(data) {
1626
- data = data.replace(/(\r\n|\n|\r)/gm,"")
1627
- versionLog('Installed version of netdata is ' + data);
1628
- document.getElementById('netdataVersion').innerHTML = data;
1629
- callback(data);
1626
+ data = data.replace(/(\r\n|\n|\r| |\t)/gm,"");
1627
+ if(data.length !== 40) {
1628
+ versionLog('Received version string is invalid.');
1629
+ callback(null);
1630
+ }
1631
+ else {
1632
+ versionLog('Installed version of netdata is ' + data);
1633
+ document.getElementById('netdataVersion').innerHTML = data;
1634
+ callback(data);
1635
+ }
1636
})
1637
.fail(function() {
1638
versionLog('Failed to download installed version info from netdata!');
@@ -1689,11 +1695,11 @@ function notifyForUpdate(force) {
1695
1696
if(sha1 === null) {
1697
save = false;
1692
- versionLog('<p><big>Failed to get your netdata version!</big></p>');
1698
+ versionLog('<p><big>Failed to get your netdata version!</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
1699
}
1700
else if(sha2 === null) {
1701
save = false;
1696
- versionLog('<p><big>Failed to get the latest version from github.</big></p>');
1702
+ versionLog('<p><big>Failed to get the latest version from github.</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
1703
}
1704
else if(sha1 === sha2) {
1705
save = true;