fix bug unpacking files

This commit is contained in:
Grahame Grieve 2019-12-06 08:55:30 +11:00
parent 5cfa89fdfc
commit f4011e96ad
1 changed files with 8 additions and 8 deletions

View File

@ -712,7 +712,7 @@ public class NpmPackage {
public void unPack(String dir, boolean withAppend) throws IOException {
for (NpmPackageFolder folder : folders.values()) {
String dn = folder.getName();
if (!dn.equals("package") && dn.startsWith("package/")) {
if (!dn.equals("package") && (dn.startsWith("package/") || dn.startsWith("package\\"))) {
dn = dn.substring(8);
}
if (dn.equals("$root")) {
@ -739,13 +739,13 @@ public class NpmPackage {
}
public void debugDump(String purpose) {
// System.out.println("Debug Dump of Package for '"+purpose+"'. Path = "+path);
// System.out.println(" npm = "+name()+"#"+version()+", canonical = "+canonical());
// System.out.println(" folders = "+folders.size());
// for (String s : sorted(folders.keySet())) {
// NpmPackageFolder folder = folders.get(s);
// System.out.println(" "+folder.dump());
// }
System.out.println("Debug Dump of Package for '"+purpose+"'. Path = "+path);
System.out.println(" npm = "+name()+"#"+version()+", canonical = "+canonical());
System.out.println(" folders = "+folders.size());
for (String s : sorted(folders.keySet())) {
NpmPackageFolder folder = folders.get(s);
System.out.println(" "+folder.dump());
}
}
private List<String> sorted(Set<String> keys) {