Fix creation of cache directory

This commit is contained in:
Casper Warden
2017-12-20 18:10:18 +00:00
parent 4f02dd6a2a
commit 3ef4285b14
3 changed files with 8 additions and 3 deletions

View File

@@ -30,7 +30,12 @@ export class InventoryFolder
{
this.agent = agent;
this.inventoryBase = invBase;
this.cacheDir = path.resolve(__dirname + '/cache/' + this.agent.agentID.toString());
const cacheLocation = path.resolve(__dirname + '/cache');
if (!fs.existsSync(cacheLocation))
{
fs.mkdirSync(cacheLocation, 0o777);
}
this.cacheDir = path.resolve(cacheLocation + '/' + this.agent.agentID.toString());
if (!fs.existsSync(this.cacheDir))
{
fs.mkdirSync(this.cacheDir, 0o777);

View File

@@ -56,7 +56,7 @@ describe('Packets', () =>
});
done();
}
catch(err)
catch (err)
{
done(err);
}

View File

@@ -1,6 +1,6 @@
{
"name": "@caspertech/node-metaverse",
"version": "0.4.2",
"version": "0.4.3",
"description": "A node.js interface for Second Life.",
"main": "dist/index.js",
"types": "dist/index.d.ts",