Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
fix(create-repo): pass sub paths in repo to each store
Browse files Browse the repository at this point in the history
  • Loading branch information
zachferland authored and jacobheun committed Mar 27, 2019
1 parent 866e4e8 commit 1113c61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions src/s3-repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,17 @@ const createRepo = (S3Store, options, s3Options) => {
createIfMissing
}

const store = new S3Store(path, storeConfig)

class Store {
constructor () {
return store
}
}

// If no lock is given, create a mock lock
lock = lock || notALock

return new IPFSRepo(path, {
storageBackends: {
root: Store,
blocks: Store,
keys: Store,
datastore: Store
root: S3Store,
blocks: S3Store,
keys: S3Store,
datastore: S3Store
},
storageBackendconfig: {
storageBackendOptions: {
root: storeConfig,
blocks: storeConfig,
keys: storeConfig,
Expand Down
2 changes: 1 addition & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe('S3Datastore', () => {

describe('createRepo', () => {
it('should be able to create a repo', () => {
const path = '.ipfs/datastore'
const path = '.ipfs'
const repo = createRepo({
path
}, {
Expand Down

0 comments on commit 1113c61

Please sign in to comment.