Merge pull request #485 from wpferguson/script_manager_api_solution

script_manager api check solution
This commit is contained in:
wpferguson
2024-06-18 00:34:30 -04:00
committed by GitHub
2 changed files with 9 additions and 5 deletions

View File

@@ -199,7 +199,7 @@ function dtutils_log.msg(level, ...)
table.remove(args, 1)
end
local log_msg = level.label
if level.engine ~= dt_screen and call_level ~= 0 then
if level.engine ~= dt_print and call_level ~= 0 then
log_msg = log_msg .. dtutils_log.caller(call_level, level.caller_info) .. " "
elseif log_msg:len() > 2 then
log_msg = log_msg .. " "

View File

@@ -68,12 +68,15 @@ end
-- api check
du.check_min_api_version("9.3.0", "script_manager")
-- du.check_min_api_version("9.3.0", "script_manager")
-- - - - - - - - - - - - - - - - - - - - - - - -
-- C O N S T A N T S
-- - - - - - - - - - - - - - - - - - - - - - - -
-- script_manager required API version
local SM_API_VER_REQD <const> = "9.3.0"
-- path separator
local PS <const> = dt.configuration.running_os == "windows" and "\\" or "/"
@@ -1189,7 +1192,7 @@ end
script_manager_running_script = "script_manager"
if check_for_updates then
if check_for_updates or SM_API_VER_REQD > dt.configuration.api_version_string then
local repo_data = get_repo_status(LUA_DIR)
local current_branch = get_current_repo_branch(LUA_DIR)
local clean = is_repo_clean(repo_data)
@@ -1246,14 +1249,15 @@ if check_for_updates then
local match = false
for _, branch in ipairs(branches) do
for _x, branch in ipairs(branches) do
log.msg(log.debug, "checking branch " .. branch .. " against API " .. LUA_API_VER)
if LUA_API_VER == branch then
match = true
log.msg(log.info, "checking out repo branch " .. branch)
checkout_repo_branch(repo, branch)
log.msg(log.screen, "you must restart darktable to use the correct version of the lua")
log.msg(log.screen, _("you must restart darktable to use the correct version of the lua scripts"))
return
end
end