Skip to content

Commit 5727b2d

Browse files
authored
Merge pull request #485 from wpferguson/script_manager_api_solution
script_manager api check solution
2 parents a3fe02b + c95f8a2 commit 5727b2d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/dtutils/log.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function dtutils_log.msg(level, ...)
199199
table.remove(args, 1)
200200
end
201201
local log_msg = level.label
202-
if level.engine ~= dt_screen and call_level ~= 0 then
202+
if level.engine ~= dt_print and call_level ~= 0 then
203203
log_msg = log_msg .. dtutils_log.caller(call_level, level.caller_info) .. " "
204204
elseif log_msg:len() > 2 then
205205
log_msg = log_msg .. " "

tools/script_manager.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,15 @@ end
6868

6969
-- api check
7070

71-
du.check_min_api_version("9.3.0", "script_manager")
71+
-- du.check_min_api_version("9.3.0", "script_manager")
7272

7373
-- - - - - - - - - - - - - - - - - - - - - - - -
7474
-- C O N S T A N T S
7575
-- - - - - - - - - - - - - - - - - - - - - - - -
7676

77+
-- script_manager required API version
78+
local SM_API_VER_REQD <const> = "9.3.0"
79+
7780
-- path separator
7881
local PS <const> = dt.configuration.running_os == "windows" and "\\" or "/"
7982

@@ -1189,7 +1192,7 @@ end
11891192

11901193
script_manager_running_script = "script_manager"
11911194

1192-
if check_for_updates then
1195+
if check_for_updates or SM_API_VER_REQD > dt.configuration.api_version_string then
11931196
local repo_data = get_repo_status(LUA_DIR)
11941197
local current_branch = get_current_repo_branch(LUA_DIR)
11951198
local clean = is_repo_clean(repo_data)
@@ -1246,14 +1249,15 @@ if check_for_updates then
12461249

12471250
local match = false
12481251

1249-
for _, branch in ipairs(branches) do
1252+
for _x, branch in ipairs(branches) do
12501253
log.msg(log.debug, "checking branch " .. branch .. " against API " .. LUA_API_VER)
12511254

12521255
if LUA_API_VER == branch then
12531256
match = true
12541257
log.msg(log.info, "checking out repo branch " .. branch)
12551258
checkout_repo_branch(repo, branch)
1256-
log.msg(log.screen, "you must restart darktable to use the correct version of the lua")
1259+
log.msg(log.screen, _("you must restart darktable to use the correct version of the lua scripts"))
1260+
return
12571261
end
12581262

12591263
end

0 commit comments

Comments
 (0)