Skip to content

Commit

Permalink
fix: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau committed Oct 17, 2019
1 parent 3be4cf9 commit f0c619a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 1 addition & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,11 @@ class IpfsRepo {
autoMigrateConfig = await this.config.get(AUTO_MIGRATE_CONFIG_KEY)
} catch (e) {
if (e.code === ERRORS.NotFoundError.code) {
autoMigrateConfig = true
autoMigrateConfig = true // Config's default value is True
} else {
throw e
}
}
log(`optin: ${this.options.autoMigrate}; config: ${autoMigrateConfig}`)

return autoMigrateConfig && this.options.autoMigrate
}
Expand All @@ -298,10 +297,6 @@ class IpfsRepo {
throw new ERRORS.InvalidRepoVersionError('Your repo\'s version is higher then this version of js-ipfs-repo require! You have to revert it.')
}

if (currentRepoVersion === toVersion) {
return
}

log('migrating to version ' + toVersion)
return migrator.migrate(this.path, { toVersion: toVersion, ignoreLock: true, repoOptions: this.options })
}
Expand Down
4 changes: 1 addition & 3 deletions test/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ async function createTempRepo ({ dontOpen, opts }) {

return {
path: repoPath,
instance: repo,
teardown: async () => {
}
instance: repo
}
}

Expand Down

0 comments on commit f0c619a

Please sign in to comment.