Updated: Pre-commit hooks/pre-commit.lua

Fixed: Run-time errors of unfinished string
This commit is contained in:
dvdvideo1234 2019-10-11 16:42:16 +03:00
parent f6393e2871
commit 17ca0feac5
3 changed files with 14 additions and 7 deletions

View File

@ -9,6 +9,8 @@ local fVer = "asmlib.SetOpVar%s*%(%s*\"TOOL_VERSION\"%s*,%s*\"%d+%.%d+\"%s*%)"
local fNum = "%s*%d+%s*%.%s*%d+%s*"
local tEnd = {["DOS"]="\r\n", ["UNX"]="\n"}
function trim(s) return s:match("^%s*(.-)%s*$") end
local sLog = tostring(arg[4]):gsub("\\","/")
local fLog, sE = io.open(sLog,"a+")
@ -52,11 +54,16 @@ while(sI) do
io.write("Version found at line ["..nL.."]\n")
local vB, vE = sI:find(fNum)
if(vB and vE) then
io.write("Version > ["..sI:sub(vB, vE).."]\n")
local nW, nF = math.modf(tonumber(sI:sub(vB, vE)))
local sF = (tonumber(tostring(nF):sub(3,-1))+1)
sI = sI:sub(1,vB-1)..nW.."."..sF..sI:sub(vE+1,-1)
io.write("Extract > ["..sF.."]\n")
print(sI:sub(vB, vE))
local nD = sI:sub(vB, vE):find(".", 1, true)
if(nD) then
local sW = trim(sI:sub(vB, vB + nD - 2))
local sF = trim(sI:sub(vB + nD, vE))
io.write("Version > ["..sW.."]["..sF.."]\n")
sF = tostring(tonumber(sF) + 1)
sI = sI:sub(1,vB-1)..sW.."."..sF..sI:sub(vE+1,-1)
io.write("Extract > ["..sF.."]\n")
end
end
end
nL = nL + 1

View File

@ -73,7 +73,7 @@ local gtInitLogs = {"*Init", false, 0}
------ CONFIGURE ASMLIB ------
asmlib.InitBase("track","assembly")
asmlib.SetOpVar("TOOL_VERSION","7.570")
asmlib.SetOpVar("TOOL_VERSION","7.571")
asmlib.SetIndexes("V" , "x", "y", "z")
asmlib.SetIndexes("A" ,"pitch","yaw","roll")
asmlib.SetIndexes("WV",1,2,3)

View File

@ -93,7 +93,7 @@ return function(sTool, sLimit) local tSet = {} -- French
tSet["tool."..sTool..".pn_ext_dsv_lb" ] = "Liste DSV externe"
tSet["tool."..sTool..".pn_ext_dsv_hd" ] = "La liste des base de données DSV sont affichées ici"
tSet["tool."..sTool..".pn_ext_dsv_1" ] = "Préfixe unique de la base de donnée"
tSet["tool."..sTool..".pn_ext_dsv_2" ] = "Active
tSet["tool."..sTool..".pn_ext_dsv_2" ] = "Active"
tSet["tool."..sTool..".pn_display" ] = "Le modèle de votre pièce de piste est affiché ici"
tSet["tool."..sTool..".pn_pattern" ] = "Écrire un modèle ici et appuyer sur ENTRÉE pour effectuer une recherche"
tSet["tool."..sTool..".pn_srchcol" ] = "Choisir la liste de colonne auquel vous voulez effectuer une recherche sur"