Comparing version 0.2.0 to 0.3.0
@@ -13,3 +13,3 @@ 'use strict'; | ||
BbPromise.onPossiblyUnhandledRejection((err) => { | ||
console.log('PANIC: Emulator may be in an inconsistent state!'); | ||
console.log('**PANIC** Something unexpected happened! Emulator may be in an inconsistent state!'); | ||
process.stderr.write(err.stack); | ||
@@ -16,0 +16,0 @@ process.abort(); |
'use strict'; | ||
const env = require('./../env'), | ||
createBlockBlobHandler = require('./../api/CreateBlockBlob'); | ||
createBlockBlobHandler = require('./../api/CreateBlockBlob'), | ||
deleteBlobHandler = require('./../api/DeleteBlob'); | ||
@@ -24,3 +25,6 @@ /* | ||
} | ||
}) | ||
.delete((req, res) => { | ||
deleteBlobHandler.process(req, res, req.params.container, req.params.blob); | ||
}); | ||
} |
@@ -61,3 +61,3 @@ 'use strict'; | ||
tables.chain().find({ 'name': { '$eq': name } }).remove(); | ||
// TODO: Delete all blobs stored in the container | ||
this.db.removeCollection(name); | ||
return this.db.saveDatabaseAsync(); | ||
@@ -134,4 +134,17 @@ }); | ||
} | ||
deleteBlob(container, name) { | ||
let blobPath = path.join(env.localStoragePath, container, name); | ||
return fs.statAsync(blobPath) | ||
.then((stat) => { | ||
return fs.removeAsync(blobPath); | ||
}) | ||
.then(() => { | ||
let coll = this.db.getCollection(container); | ||
coll.chain().find({ 'name': { '$eq': name } }).remove(); | ||
return this.db.saveDatabaseAsync(); | ||
}); | ||
} | ||
} | ||
module.exports = new StorageManager; |
{ | ||
"name": "azurite", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A lightweight server clone of Azure Blob Storage that simulates most of the commands supported by it with minimal dependencies.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28658
20
538