Skip to content

Commit

Permalink
chore: upgrade aegir and deps (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov authored and daviddias committed Nov 13, 2017
1 parent f4c0d19 commit 0693e8b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 31 deletions.
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"description": "simple controls for an ipfs node",
"main": "src/index.js",
"scripts": {
"lint": "aegir-lint",
"coverage": "aegir-coverage",
"test": "aegir-test --env node",
"docs": "aegir-docs",
"release": "aegir-release --env node --docs",
"release-minor": "aegir-release --type minor --env node --docs",
"release-major": "aegir-release --type major --env node --docs",
"coverage-publish": "aegir-coverage publish"
"lint": "aegir lint",
"coverage": "aegir coverage",
"test": "aegir test -t node",
"docs": "aegir docs",
"release": "aegir release -t node",
"release-minor": "aegir release --type minor -t node",
"release-major": "aegir release --type major -t node",
"coverage-publish": "aegir coverage -u"
},
"engines": {
"node": ">=6.0.0",
Expand Down Expand Up @@ -50,18 +50,22 @@
"license": "MIT",
"dependencies": {
"async": "^2.5.0",
"detect-node": "^2.0.3",
"eslint-config-standard-jsx": "^4.0.2",
"go-ipfs-dep": "0.4.11",
"ipfs-api": "^14.3.5",
"multiaddr": "^3.0.1",
"once": "^1.4.0",
"rimraf": "^2.6.2",
"shutdown": "^0.3.0",
"subcomandante": "^1.0.5"
"subcomandante": "^1.0.5",
"truthy": "0.0.1"
},
"devDependencies": {
"aegir": "^11.0.2",
"aegir": "^12.1.3",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"ipfs": "^0.26.0",
"is-running": "1.0.5",
"mkdirp": "^0.5.1",
"multihashes": "~0.4.10",
Expand All @@ -80,4 +84,4 @@
"example": "examples",
"test": "test"
}
}
}
25 changes: 13 additions & 12 deletions src/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function setConfigValue (node, key, value, callback) {
exec(
node.exec,
['config', key, value, '--json'],
{env: node.env},
{ env: node.env },
callback
)
}
Expand Down Expand Up @@ -98,7 +98,7 @@ class Node {
this.subprocess = null
this.initialized = fs.existsSync(path)
this.clean = true
this.env = Object.assign({}, process.env, {IPFS_PATH: path})
this.env = Object.assign({}, process.env, { IPFS_PATH: path })
this.disposable = disposable
this._apiAddr = null
this._gatewayAddr = null
Expand Down Expand Up @@ -152,7 +152,7 @@ class Node {
this.env.IPFS_PATH = this.path
}

this._run(['init', '-b', keySize], {env: this.env}, (err, result) => {
this._run(['init', '-b', keySize], { env: this.env }, (err, result) => {
if (err) {
return callback(err)
}
Expand Down Expand Up @@ -226,14 +226,14 @@ class Node {
let output = ''
let returned = false

this.subprocess = this._run(args, {env: this.env}, {
this.subprocess = this._run(args, { env: this.env }, {
error: (err) => {
// Only look at the last error
const input = String(err)
.split('\n')
.map((l) => l.trim())
.filter(Boolean)
.slice(-1)[0] || ''
.split('\n')
.map((l) => l.trim())
.filter(Boolean)
.slice(-1)[0] || ''

if (input.match('daemon is running')) {
// we're good
Expand Down Expand Up @@ -348,7 +348,7 @@ class Node {
async.waterfall([
(cb) => this._run(
['config', key],
{env: this.env},
{ env: this.env },
cb
),
(config, cb) => {
Expand All @@ -371,7 +371,7 @@ class Node {
setConfig (key, value, callback) {
this._run(
['config', key, value, '--json'],
{env: this.env},
{ env: this.env },
callback
)
}
Expand All @@ -386,18 +386,19 @@ class Node {
replaceConf (file, callback) {
this._run(
['config', 'replace', file],
{env: this.env},
{ env: this.env },
callback
)
}

/**
* Get the version of ipfs
*
* @param {function(Error, string)} callback
* @returns {undefined}
*/
version (callback) {
this._run(['version'], {env: this.env}, callback)
this._run(['version'], { env: this.env }, callback)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const IpfsDaemonController = {
callback = path
path = process.env.IPFS_PATH ||
join(process.env.HOME ||
process.env.USERPROFILE, '.ipfs')
process.env.USERPROFILE, '.ipfs')
}

process.nextTick(() => callback(null, new Node(path, opts)))
Expand Down Expand Up @@ -86,7 +86,7 @@ const IpfsDaemonController = {
const node = new Node(repoPath, options, disposable)

if (typeof options.init === 'boolean' &&
options.init === false) {
options.init === false) {
process.nextTick(() => callback(null, node))
} else {
node.init((err) => callback(err, node))
Expand Down
4 changes: 1 addition & 3 deletions test/npm-installs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ describe('ipfs executable path', () => {
const node = new Daemon()

expect(node.exec)
.to.eql(
path.join(tmp, `ipfsd-ctl-test/node_modules/ipfsd-ctl/node_modules/go-ipfs-dep/go-ipfs/${appName}`)
)
.to.eql(path.join(tmp, `ipfsd-ctl-test/node_modules/ipfsd-ctl/node_modules/go-ipfs-dep/go-ipfs/${appName}`))
rimraf(path.join(tmp, 'ipfsd-ctl-test'), done)
})
})
Expand Down
8 changes: 5 additions & 3 deletions test/spawning-daemons.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('daemon spawning', () => {

// actually running?
done = once(done)
exec('kill', ['-0', pid], {cleanup: true}, () => done())
exec('kill', ['-0', pid], { cleanup: true }, () => done())
})
})

Expand All @@ -180,7 +180,7 @@ describe('daemon spawning', () => {

// make sure it's not still running
const poll = setInterval(() => {
exec('kill', ['-0', pid], {cleanup: true}, {
exec('kill', ['-0', pid], { cleanup: true }, {
error () {
clearInterval(poll)
done()
Expand Down Expand Up @@ -335,7 +335,9 @@ describe('daemon spawning', () => {
// skip on windows for now
// https://github.com/ipfs/js-ipfsd-ctl/pull/155#issuecomment-326970190
// fails on windows see https://github.com/ipfs/js-ipfs-api/issues/408
if (isWindows) { return it.skip('uses the correct ipfs-api') }
if (isWindows) {
return it.skip('uses the correct ipfs-api')
}

it('uses the correct ipfs-api', (done) => {
ipfs.util.addFromFs(path.join(__dirname, 'fixtures/'), {
Expand Down

0 comments on commit 0693e8b

Please sign in to comment.