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.write(cnt);
tar.closeArchiveEntry();
cnt = TextFile.fileToBytes(filename);
new File(filename).delete();
entry = new TarArchiveEntry(n+"/.index.db");
entry.setSize(cnt.length);
tar.putArchiveEntry(entry);
tar.write(cnt);
tar.closeArchiveEntry();
var file = new File(filename);
if (file.exists()) {
cnt = TextFile.fileToBytes(file);
file.delete();
entry = new TarArchiveEntry(n+"/.index.db");
entry.setSize(cnt.length);
tar.putArchiveEntry(entry);
tar.write(cnt);
tar.closeArchiveEntry();
}
}
byte[] cnt = TextFile.stringToBytes(JsonParser.compose(npm, true), false);
TarArchiveEntry entry = new TarArchiveEntry("package/package.json");