#3 - Fix unzipper.extract (#4)

This commit is contained in:
divyabshiva 2023-12-15 13:33:16 -05:00 committed by GitHub
parent 767d02d86f
commit 47170b199d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View file

@ -1,9 +1,9 @@
{
"id": "hunchly",
"name": "Hunchly",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.15.0",
"description": "Import notes and images from Hunchly.",
"description": "This plugin converts Hunchly's notes and captioned images into obsidian notes. Also adds selectors from hunchly as obsidian tags.",
"author": "sapperlabs",
"isDesktopOnly": true
}

View file

@ -1,7 +1,7 @@
{
"name": "hunchly-obsidian-plugin",
"version": "1.0.0",
"description": "Import Hunchly notes and images into obsidian",
"version": "1.0.1",
"description": "This plugin converts Hunchly's notes and captioned images into obsidian notes. Also adds selectors from hunchly as obsidian tags.",
"main": "main.js",
"scripts": {
"dev": "node esbuild.config.mjs",

View file

@ -62,11 +62,8 @@ export class Hunchly{
const tempDir = tmp.dirSync({ unsafeCleanup: true });
const extractionPath = tempDir.name;
// Create a read stream for the zip file.
const readStream = fs.createReadStream(zipFilePath);
// Pipe the read stream through unzipper to extract the contents.
await readStream.pipe(unzipper.Extract({ path: extractionPath })).promise();
// unzip the file
await unzipper.Open.file(zipFilePath).then(d => d.extract({path: extractionPath, concurrency: 5}));
if (!await this.checkFileOrFolderExistence(extractionPath, "case_data")){
new Notice("Not a valid hunchly case file. Use Export > Export Case in the hunchly dashboard.", 5000)