Skip to content

Commit 665a4c5

Browse files
cr round 1
1 parent 5faa629 commit 665a4c5

File tree

3 files changed

+8
-35
lines changed

3 files changed

+8
-35
lines changed

src/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,25 @@ module.exports = class Repo {
1414

1515
const blobStores = initializeBlobStores(options.stores)
1616

17-
const setup = (name, needsLocks, needsConfig) => {
17+
const setup = (name, needs) => {
18+
needs = needs || {}
1819
const args = [repoPath, blobStores[name]]
19-
if (needsLocks) {
20+
if (needs.locks) {
2021
args.push(this.locks)
2122
}
2223

23-
if (needsConfig) {
24+
if (needs.config) {
2425
args.push(this.config)
2526
}
2627

2728
return stores[name].setUp.apply(stores[name], args)
2829
}
2930

3031
this.locks = setup('locks')
31-
this.version = setup('version', true)
32-
this.config = setup('config', true)
33-
this.keys = setup('keys', true, true)
34-
this.blockstore = setup('blockstore', true)
32+
this.version = setup('version', {locks: true})
33+
this.config = setup('config', {locks: true})
34+
this.keys = setup('keys', {locks: true, config: true})
35+
this.blockstore = setup('blockstore', {locks: true})
3536
}
3637

3738
exists (callback) {

src/stores/datastore.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/stores/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ exports.version = require('./version')
77
exports.config = require('./config')
88
exports.keys = require('./keys')
99
exports.blockstore = require('./blockstore')
10-
// exports.datastore = require('./datastore')
11-
// exports.logs = require('./logs')

0 commit comments

Comments
 (0)