Open doremifaJ opened 2 years ago
Why not support relative path?
getting the same error
try { await extract(file, { dir: "app/my-downloads/es" <====== my folder name where i want the files to extracted }) console.log('Extraction complete') } catch (err) { console.log("Error",err); // handle any errors }
find this code => if (!path.isAbsolute(opts.dir) in extract-zip/index.html and comment it out to use relative path :)
As a workaround I convert the target directory path to absolute path using Node's path.resolve
.
"postdownload:script:win": "powershell -Command \"$path = (Resolve-Path .).Path + '\_your_relpath'; if (-Not (Test-Path $path)) { New-Item -ItemType Directory -Force -Path $path }; [System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem'); [System.IO.Compression.ZipFile]::ExtractToDirectory('_zipped_filename.zip', $path); Remove-Item _zipped_filename.zip\"",
"postdownload:script:win": "powershell -Command \"$path = (Resolve-Path .).Path + '\\your_rel_path'; if (-Not (Test-Path $path)) { New-Item -ItemType Directory -Force -Path $path }; [System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem'); [System.IO.Compression.ZipFile]::ExtractToDirectory('zipped_file_name.zip', $path); Remove-Item zipped_file_name.zip\"",
Why not support relative path?