Closed edbingo closed 1 year ago
This is actually already possible with the -i
parameter. Please see https://github.com/thingweb/thingweb-playground/tree/master/packages/cli#parameters
This doesn't seem to be working for me:
> node packages/cli/index.js -i packages/core/examples/tms/valid/affordances.json packages/core/examples/tms/valid/security.json
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of Array
Sorry, I have misunderstood your comment. Currently, you can either specify a single file or a single folder. You want to pass multiple file names right?
Exactly. This could be done pretty unintrusively with a for/of loop:
let inputArray = myArguments.input
if (myArguments.type === 'TD') {
for (input of inputArray) {
if (myArguments.assertions === true) {
tdAssertionReport(input)
}
else if (myArguments.openApi === true) {
openApiGeneration(input)
}
else if (myArguments.asyncApi === true) {
asyncApiGeneration(input)
}
else if (myArguments.defaultAdd === true || myArguments.defaultRem === true) {
defaultManipulation(input)
}
else {
coreValidation(input)
}
}
}
See here
This looks good to me, can you add a corresponding test as well?
It would be useful if you could pass multiple files / folders with the input flag. This seems like an easy fix using a for/of loop.