feat: optimize decompression

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-03-02 10:34:30 +08:00
parent 367b732f7c
commit ea8e62b696

View File

@ -271,7 +271,7 @@
// @ts-ignore // @ts-ignore
var entry; var target = root + separatorChar + 'node_modules' + separatorChar + module_name; var entry; var target = root + separatorChar + 'node_modules' + separatorChar + module_name;
while ((entry = tis.getNextEntry()) != null) { while ((entry = tis.getNextEntry()) != null) {
var targetPath = Paths.get(target + separatorChar + entry.getName().substring('package/'.length)); var targetPath = Paths.get(target + separatorChar + entry.getName().substring(8));
targetPath.toFile().getParentFile().mkdirs(); targetPath.toFile().getParentFile().mkdirs();
Files.copy(tis, targetPath, StandardCopyOption.REPLACE_EXISTING); Files.copy(tis, targetPath, StandardCopyOption.REPLACE_EXISTING);
} }