Skip to content
Snippets Groups Projects
Unverified Commit 2c65f083 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-autoupdater: factor out default_branch() function

Make the code clearer and prepare for invalid branch fixup.
parent db48b6b6
No related branches found
No related tags found
No related merge requests found
......@@ -21,16 +21,21 @@ for name, config in pairs(site.autoupdater.branches()) do
end
end
if not uci:get('autoupdater', 'settings') then
local enabled = unistd.access('/lib/gluon/autoupdater/default_enabled') ~= nil
local branch = site.autoupdater.branch(min_branch)
local function default_branch()
local f = io.open('/lib/gluon/autoupdater/default_branch')
if f then
branch = f:read('*line')
local ret = f:read('*line')
f:close()
return ret
end
return site.autoupdater.branch(min_branch)
end
if not uci:get('autoupdater', 'settings') then
local enabled = unistd.access('/lib/gluon/autoupdater/default_enabled') ~= nil
local branch = default_branch()
if not branch then
enabled = false
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment