Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ async function downloadPrebuilt() {
const tempPath = path.join(VENDOR_DIR, `_dl.${process.pid}.tgz`);
try {
await pipeline(Readable.fromWeb(response.body), fs.createWriteStream(tempPath));
const tar = spawnSync('tar', ['-xzf', tempPath, '-C', VENDOR_DIR], {stdio: 'inherit'});
// Pass tar a *relative* filename via cwd, not an absolute path.
// Windows' bsdtar treats `C:\...` as a `host:path` remote spec
// ("Cannot connect to C: resolve failed"); using a basename with
// cwd avoids that ambiguity and works identically on POSIX.
const tar = spawnSync('tar', ['-xzf', path.basename(tempPath)], {cwd: VENDOR_DIR, stdio: 'inherit'});
if (tar.status !== 0) {
throw new Error(`tar extraction exited with status ${tar.status}`);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jpegtran-bin",
"version": "7.2.0",
"version": "7.2.1",
"description": "jpegtran (part of libjpeg-turbo) wrapper that makes it seamlessly available as a local dependency",
"license": "MIT",
"repository": "PruvoNet/jpegtran-bin",
Expand Down
Loading