This commit is contained in:
Grahame Grieve 2023-09-15 22:08:35 -07:00
parent 4d2868f21e
commit 3681614ce3
1 changed files with 10 additions and 7 deletions

View File

@ -1137,13 +1137,16 @@ public class NpmPackage {
tar.putArchiveEntry(entry); tar.putArchiveEntry(entry);
tar.write(cnt); tar.write(cnt);
tar.closeArchiveEntry(); tar.closeArchiveEntry();
cnt = TextFile.fileToBytes(filename); var file = new File(filename);
new File(filename).delete(); if (file.exists()) {
entry = new TarArchiveEntry(n+"/.index.db"); cnt = TextFile.fileToBytes(file);
entry.setSize(cnt.length); file.delete();
tar.putArchiveEntry(entry); entry = new TarArchiveEntry(n+"/.index.db");
tar.write(cnt); entry.setSize(cnt.length);
tar.closeArchiveEntry(); tar.putArchiveEntry(entry);
tar.write(cnt);
tar.closeArchiveEntry();
}
} }
byte[] cnt = TextFile.stringToBytes(JsonParser.compose(npm, true), false); byte[] cnt = TextFile.stringToBytes(JsonParser.compose(npm, true), false);
TarArchiveEntry entry = new TarArchiveEntry("package/package.json"); TarArchiveEntry entry = new TarArchiveEntry("package/package.json");