alexanderwe / the-traveler

The Traveler is a small npm package which wraps around the Destiny 2 API.
https://alexanderwe.github.io/the-traveler/
MIT License
56 stars 10 forks source link

Fails to unzip manifest file #39

Closed ghost closed 5 years ago

ghost commented 5 years ago

Bug Report

Your Environment

Software Version(s)
the-traveler 0.7.4
Node 8.9.1
Operating System Ubuntu Server 16.04 LTS

Expected Behavior

Expected the downloadManifest method to unzip the manifest file in the directory specified as stated in the documentation

Current Behavior

an error results stating the unzipping the file failed.

(node:28670) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Error extracting zip
(node:28670) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Code Sample

const result = await self.Destiny2.Api.getDestinyManifest();
const filepath = await self.Destiny2.Api.downloadManifest(result.Response.mobileWorldContentPaths.en, '../destiny-2/manifest.content' );
const manifest = new Manifest( filepath );
const queryResult = await manifest.queryManifest( 'SELECT name FROM sqlite_master WHERE type="table"' );

console.log( queryResult );
ghost commented 5 years ago

I just tried to use __dirname + '../destiny-2/manifest.content' as the second parameter as well but got the same error

ghost commented 5 years ago

this was my issue. i needed __dirname + '/..destiny-2/manifest.content'. The file successfully unzips now