]> arthur.barton.de Git - netdata.git/commitdiff
installation fix: all it build if .git is not present, #194
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 7 Apr 2016 09:30:37 +0000 (12:30 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 7 Apr 2016 09:30:37 +0000 (12:30 +0300)
web/Makefile.am
web/index.html

index 387119598ddefc5a5af8edfdab21c691a3c608ed..b162ae1b09df195653ba77f7725a105bd1a176f1 100644 (file)
@@ -97,8 +97,10 @@ version.txt:
                        rm -f v.tmp; \
                else \
                        rm -f v.tmp; \
-                       false; \
+                       echo "0" > version.txt; \
                fi; \
+       else \
+               echo "0" > version.txt; \
        fi
 
 .PHONY: version.txt
index 4416307d20110ab5b37e48bb7c76b4633f04adda..c10988213f66f69fe6cb28b8207087530df64c28 100644 (file)
@@ -1623,10 +1623,16 @@ function getNetdataVersion(callback) {
                cache: false
        })
        .done(function(data) {
-               data = data.replace(/(\r\n|\n|\r)/gm,"")
-               versionLog('Installed version of netdata is ' + data);
-               document.getElementById('netdataVersion').innerHTML = data;
-               callback(data);
+               data = data.replace(/(\r\n|\n|\r| |\t)/gm,"");
+               if(data.length !== 40) {
+                       versionLog('Received version string is invalid.');
+                       callback(null);
+               }
+               else {
+                       versionLog('Installed version of netdata is ' + data);
+                       document.getElementById('netdataVersion').innerHTML = data;
+                       callback(data);
+               }
        })
        .fail(function() {
                versionLog('Failed to download installed version info from netdata!');
@@ -1689,11 +1695,11 @@ function notifyForUpdate(force) {
 
                if(sha1 === null) {
                        save = false;
-                       versionLog('<p><big>Failed to get your netdata version!</big></p>');
+                       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>');
                }
                else if(sha2 === null) {
                        save = false;
-                       versionLog('<p><big>Failed to get the latest version from github.</big></p>');
+                       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>');
                }
                else if(sha1 === sha2) {
                        save = true;