Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
61caf51f4e | |||
be4e2cdae7 | |||
1cb8331666 | |||
aa203c5ab2 | |||
87aedd5ef5 | |||
64431703b5 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@push.rocks/smartarchive",
|
||||
"version": "4.0.34",
|
||||
"version": "4.0.37",
|
||||
"description": "A library for working with archive files, providing utilities for compressing and decompressing data.",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartarchive',
|
||||
version: '4.0.34',
|
||||
version: '4.0.37',
|
||||
description: 'A library for working with archive files, providing utilities for compressing and decompressing data.'
|
||||
}
|
||||
|
@ -21,12 +21,17 @@ export class TarTools {
|
||||
}
|
||||
): Promise<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
let fileName =
|
||||
optionsArg.fileName || optionsArg.content instanceof plugins.smartfile.SmartFile
|
||||
? (optionsArg.content as plugins.smartfile.SmartFile).relative
|
||||
: null || optionsArg.content instanceof plugins.smartfile.StreamFile
|
||||
? (optionsArg.content as plugins.smartfile.StreamFile).relativeFilePath
|
||||
: null || optionsArg.filePath;
|
||||
let fileName: string | null = null;
|
||||
|
||||
if (optionsArg.fileName) {
|
||||
fileName = optionsArg.fileName;
|
||||
} else if (optionsArg.content instanceof plugins.smartfile.SmartFile) {
|
||||
fileName = (optionsArg.content as plugins.smartfile.SmartFile).relative;
|
||||
} else if (optionsArg.content instanceof plugins.smartfile.StreamFile) {
|
||||
fileName = (optionsArg.content as plugins.smartfile.StreamFile).relativeFilePath;
|
||||
} else if (optionsArg.filePath) {
|
||||
fileName = optionsArg.filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* contentByteLength is used to set the size of the entry in the tar file
|
||||
@ -86,9 +91,7 @@ export class TarTools {
|
||||
);
|
||||
|
||||
content.pipe(entry);
|
||||
entry.on('end', () => {
|
||||
resolve();
|
||||
});
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user