fix(core): update

This commit is contained in:
2023-11-06 19:46:02 +01:00
parent 77e75ee0d9
commit 401150bd10
3 changed files with 7 additions and 17 deletions

View File

@@ -35,21 +35,7 @@ tap.test('should extract existing files on disk', async () => {
const testSmartarchive = await smartarchive.SmartArchive.fromArchiveUrl(
'https://verdaccio.lossless.digital/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz'
);
const streamfileStream = await testSmartarchive.exportToStreamOfStreamFiles();
streamfileStream.pipe(new plugins.smartstream.SmartDuplex({
objectMode: true,
writeAndTransformFunction: async (chunkArg: plugins.smartfile.StreamFile, streamtools) => {
console.log(chunkArg.relativeFilePath);
const streamFile = chunkArg;
const readStream = await streamFile.createReadStream();
const writePath = plugins.path.join(testPaths.nogitDir + streamFile.relativeFilePath);
const dir = plugins.path.parse(writePath).dir;
await plugins.smartfile.fs.ensureDir(plugins.path.dirname(dir));
const writeStream = plugins.smartfile.fsStream.createWriteStream(writePath);
readStream.pipe(writeStream);
},
}));
const streamfileStream = await testSmartarchive.exportToFs(testPaths.nogitDir);
});
tap.start();