js/jsfun/fnZip.js zip操作
let zipFile=fnJsa_jsCodePath()+"/aa.zip"
// //压缩不存在的文件或目录
// fnZip_zip(fnJsa_jsCodePath()+"/demoresource2/",zipFile)
// // //压缩目录
// fnZip_zip(fnJsa_jsCodePath()+"/demoresource/",zipFile)
let tmpPath=fnJsa_jsCodePath()+"/demoresource/";
//压缩文件列表,添加套根目录
// zipFile=fnJsa_jsCodePath()+"/aa_2.zip"
// let files=[tmpPath+"aa.txt",tmpPath+"test.json",tmpPath+"io/"]
// fnZip_zip(files,zipFile)
//压缩文件列表,添加套根目录
zipFile=fnJsa_jsCodePath()+"/aa_3.zip"
let files2={"aa/aa.txt": tmpPath+"aa.txt","bb/cc.json": tmpPath+"test.json","dd/": tmpPath+"io/"}
fnZip_zip(files2,zipFile)
//追加文件
// fnZip_zip(fnJsa_jsCodePath()+"/runtime/",zipFile)
// //解压缩目录
// fnZip_unzip(zipFile,fnJsa_jsCodePath()+"/demoresource2/")
//将内置资源包释放出来
let bytes = fnInnerResouce_getBytes("jsaresource/jssaas_pkg.zip")
if (bytes == null || bytes.length == 0) {
return "内置资源不存在";
}
let jscodePath = fnJsa_jsCodePath()
let tmpZip = jscodePath + "/tmp.zip"
fnIO_saveFileByte(tmpZip, bytes);
fnZip_unzipFile(tmpZip, jscodePath + "/tmp" , ["emptyproject/"])