chg: adding execute/home/current working directory functions to lua

This commit is contained in:
iceman1001 2020-05-19 09:13:31 +02:00
commit 966bcc0d28
5 changed files with 64 additions and 24 deletions

View file

@ -7,15 +7,15 @@ local ansicolors = require('ansicolors')
copyright = ''
author = 'Iceman'
version = 'v1.0.2'
version = 'v1.0.3'
desc = [[
This script will load several traces files in ../traces/ folder and do
This script will load several traces files in current working directory/traces/ folder and do
"data load"
"lf search 1 u"
The following tracefiles will be loaded:
em*.pm3
m*.pm3
modulation*.pm3
]]
example = [[
1. script run tracetest
@ -78,8 +78,10 @@ local function main(args)
print( string.rep('--',20) )
local cmdDataLoad = 'data load %s';
local tracesEM = "find '../traces/' -iname 'em*.pm3' -type f"
local tracesMOD = "find '../traces/' -iname 'm*.pm3' -type f"
local cwd = core.cwd();
local tracesEM = "find '"..cwd.."/traces/ ' -iname 'em*.pm3' -type f"
local tracesMOD = "find '"..cwd.."/traces/' -iname 'modulation*.pm3' -type f"
local write2File = false
local outputTemplate = os.date('testtest_%Y-%m-%d_%H%M%S')
@ -100,7 +102,7 @@ local function main(args)
end
p.close();
-- Find a set of traces staring with MOD
-- Find a set of traces staring with MODULATION
p = assert( io.popen(tracesMOD) )
for file in p:lines() do
table.insert(files, file)