Hi,
you can use the standard linux API:
var folder = execCommand('mktemp -d', true); // [0, "/tmp/tmp.0351385kt "]
folder = folder[1].trim(); // remove any whitespace
logInfo('folder '+folder);
execCommand('touch '+folder+'/myfile1', true); // create some files in the folder
execCommand('touch '+folder+'/myfile2', true);
var zip = execCommand('zip '+folder+'/myzip.zip '+folder); // [0, ""]
logInfo(zip[1]);
var ls = execCommand('ls -alh '+folder); // [0, "myfile1 myfile2 myzip.zip"]
logInfo(ls[1]);
Reference:
- Linux zip https://linux.die.net/man/1/zip
- Linux mktemp https://linux.die.net/man/1/mktemp
- ACC execCommand