Skip to content

Commit 88e4ac1

Browse files
committed
tools/script_manager - changed API check from hard (crash) to soft
which allows script_manager to fix tthe problem by checking out the correct version of the scripts for the API version.
1 parent a3fe02b commit 88e4ac1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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)