Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: Node.js 10 support #1358

Merged
merged 4 commits into from
May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories.
javascript()
javascript(['nodejs_versions': ['8.11.1','9.2.0','10.0.0']])
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
"ipfs-block": "~0.7.1",
"ipfs-block-service": "~0.14.0",
"ipfs-multipart": "~0.1.0",
"ipfs-repo": "~0.20.0",
"ipfs-repo": "~0.22.1",
"ipfs-unixfs": "~0.1.14",
"ipfs-unixfs-engine": "~0.29.0",
"ipld": "~0.17.0",
"ipld": "~0.17.1",
"ipld-dag-cbor": "~0.12.0",
"ipld-dag-pb": "~0.14.4",
"is-ipfs": "~0.3.2",
Expand Down
10 changes: 9 additions & 1 deletion src/core/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const waterfall = require('async/waterfall')
const series = require('async/series')
const extend = require('deep-extend')
const RepoErrors = require('ipfs-repo').errors

// Boot an IPFS node depending on the options set
module.exports = (self) => {
Expand Down Expand Up @@ -40,7 +41,14 @@ module.exports = (self) => {
// which happens when the version file is not found
// we just want to signal that no repo exist, not
// fail the whole process.
// TODO: improve datastore and ipfs-repo implemenations so this error is a bit more unified

// Use standardized errors as much as possible
if (err.code === RepoErrors.ERR_REPO_NOT_INITIALIZED) {
return cb(null, false)
}

// TODO: As error codes continue to be standardized, this logic can be phase out;
// it is here to maintain compatability
if (err.message.match(/not found/) || // indexeddb
err.message.match(/ENOENT/) || // fs
err.message.match(/No value/) // memory
Expand Down