Compare commits

..

2 Commits

Author SHA1 Message Date
9ad70a9942 1.0.21 2019-10-20 00:45:12 +02:00
bc41089925 fix(core): update 2019-10-20 00:45:11 +02:00
4 changed files with 10 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartbucket",
"version": "1.0.20",
"version": "1.0.21",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartbucket",
"version": "1.0.20",
"version": "1.0.21",
"description": "simple cloud independent object storage",
"main": "dist/index.js",
"typings": "dist/index.d.ts",

View File

@ -67,6 +67,13 @@ tap.test('should get base directory', async () => {
expect(files.length).to.equal(1);
});
tap.test('should correctly build paths for sub directories', async () => {
const dir1 = await baseDirectory.getSubDirectoryByName('dir1');
expect(dir1).to.be.instanceOf(smartbucket.Directory);
const dir1BasePath = dir1.getBasePath();
console.log(dir1BasePath);
});
tap.test('clean up directory style tests', async () => {
await myBucket.fastRemove('dir1/file1.txt');
await myBucket.fastRemove('dir1/file2.txt');

View File

@ -43,7 +43,7 @@ export class Directory {
const parentDirectories = this.getParentDirectories();
let basePath = '';
for (const parentDir of parentDirectories) {
basePath = parentDir.name + '/' + basePath;
basePath = parentDir.name + '/' + this.name;
}
return basePath;
}