From 88e4ac1a64fdb974763a24522490847d268dd516 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Tue, 18 Jun 2024 00:29:27 -0400 Subject: [PATCH] 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. --- tools/script_manager.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 955f483..40a6962 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -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 = "9.3.0" + -- path separator local PS = 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