contrib/autostyle replaced io.popen functions with wrapper

contrib/color_profile_manager    to properly quote windows commands so
contrib/fujifilm_dynamic_range   that they are sanitized for special
contrib/fujifilm_ratings         characters and spaces
contrib/geoJSON_export
contrib/geoToolbox
contrib/image_stack
contrib/image_time
contrib/kml_export
official/enfuse
tools/executable_manager
tools/get_lib_manpages
tools/get_libdoc
This commit is contained in:
Bill Ferguson
2024-06-04 23:43:21 -04:00
parent fe48d7498c
commit 038418b89f
13 changed files with 28 additions and 18 deletions

View File

@@ -31,6 +31,7 @@
local dt = require "darktable"
local du = require "lib/dtutils"
local df = require "lib/dtutils.file"
local dtsys = require "lib/dtutils.system"
du.check_min_api_version("7.0.0", "executable_manager")
@@ -75,7 +76,7 @@ local function grep(file, pattern)
if dt.configuration.running_os == "windows" then
-- use find to get the matches
local command = "\\windows\\system32\\find.exe " .. "\"" .. pattern .. "\"" .. " " .. file
local f = io.popen(command)
local f = dtsys.io_popen(command)
local output = f:read("all")
f:close()
-- strip out the first line
@@ -84,7 +85,7 @@ local function grep(file, pattern)
else
-- use grep and just return the answers
local command = "grep " .. pattern .. " " .. file
local f = io.popen(command)
local f = dtsys.io_popen(command)
local output = f:read("all")
f:close()
result = du.split(output, "\n")