mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 10:53:56 +08:00
update 2026-10-03 17:36:19
This commit is contained in:
1 parent
ba8090b29d
commit
7a2d332eaf
1968 files changed
+1523393
-89
No files matched your search
@@ -215,7 +215,7 @@ end
|
||||
function exec_call(cmd)
|
||||
math.randomseed(os.time())
|
||||
local tag = "\x01__RC__" .. tostring(math.random(100000, 999999)) .. "\x01"
|
||||
local f = io.popen('(' .. cmd .. '); printf "\\n' .. tag .. '%d" "$?"')
|
||||
local f = io.popen('(' .. cmd .. ') 2>&1; printf "\\n' .. tag .. '%d" "$?"')
|
||||
local out = f:read("*a") or ""
|
||||
f:close()
|
||||
local rc = out:match(tag .. "(%d+)%s*$")
|
||||
|
||||
@@ -55,10 +55,9 @@ function geo_convert_srs(var)
|
||||
if not fs.access(output_srs_file) and bin then
|
||||
local cmd = string.format("%q -type %q -action convert -input %q -list %q -output %q -lowmem=true",
|
||||
bin, prefix, geo_path, rule_name, output_srs_file)
|
||||
sys.call(cmd)
|
||||
local status = fs.access(output_srs_file) and "success." or "failed!"
|
||||
if status == "failed!" then
|
||||
api.log(0, string.format(" - %s:%s convert to srs %s", prefix, rule_name, status))
|
||||
local code, out = api.exec_call(cmd)
|
||||
if code ~= 0 or not fs.access(output_srs_file) then
|
||||
api.log(0, string.format(" - %s:%s convert to srs %s [%s]", prefix, rule_name, "failed!", out))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user