From f817ef6925987f231a83b85dbf1b169339c7a16f Mon Sep 17 00:00:00 2001 From: wez3 Date: Mon, 23 Jan 2017 19:04:07 +0100 Subject: [PATCH] Fix for git issue #83 --- modules/webconfig.py | 9 ++++++--- static/js/domoboard.js | 10 ++++++++-- templates/settings.html | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/webconfig.py b/modules/webconfig.py index 6b63d70..5009d89 100644 --- a/modules/webconfig.py +++ b/modules/webconfig.py @@ -23,6 +23,9 @@ def performUpgrade(): return "Upgrade completed." def getCurrentBranch(): - repo = git.Repo('.') - branch = repo.active_branch - return branch.name + try: + repo = git.Repo('.') + branch = repo.active_branch + return branch.name + except: + return "None" diff --git a/static/js/domoboard.js b/static/js/domoboard.js index b47a3c1..b03982c 100644 --- a/static/js/domoboard.js +++ b/static/js/domoboard.js @@ -434,8 +434,10 @@ function checkVersion(branch) { success: function( data ) { if (branch == "master") { dataFloat = data.split(",")[0]; - } else { + } else if (branch == "develop") { dataFloat = data.split(",")[1]; + } else { + return 0; } var compare = versionCompare(dataFloat, version); if (compare == 1) { @@ -456,8 +458,12 @@ function checkVersionSettings(branch) { success: function( data ) { if (branch == "master") { dataFloat = data.split(",")[0]; - } else { + } else if (branch == "develop") { dataFloat = data.split(",")[1]; + } else { + $( "#updateView_no_git" ).removeClass("hide_update"); + $( "#updateView_no_git" ).addClass("show_update"); + return 0; } var compare = versionCompare(dataFloat, version); if (compare == 1) { diff --git a/templates/settings.html b/templates/settings.html index ce9dc00..85ed95c 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -30,6 +30,10 @@

Hurray!


There is no update available for Domoboard.

+
+

To bad!


+ Your Domoboard cannot update itself. Domoboard needs to installed through a git clone in order to support auto-update. Updates are performed using git.

+