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

Commit

Permalink
feat: add resolve cmd (#826)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw authored Aug 6, 2018
1 parent ef5a4a3 commit c7ad0e4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"eslint-plugin-react": "^7.10.0",
"go-ipfs-dep": "~0.4.17",
"gulp": "^3.9.1",
"interface-ipfs-core": "~0.75.0",
"interface-ipfs-core": "~0.75.1",
"ipfsd-ctl": "~0.39.0",
"pull-stream": "^3.6.8",
"socket.io": "^2.1.1",
Expand Down
22 changes: 22 additions & 0 deletions src/resolve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const promisify = require('promisify-es6')

const transform = function (res, callback) {
callback(null, res.Path)
}

module.exports = (send) => {
return promisify((args, opts, callback) => {
if (typeof (opts) === 'function') {
callback = opts
opts = {}
}

send.andTransform({
path: 'resolve',
args: args,
qs: opts
}, transform, callback)
})
}
1 change: 1 addition & 0 deletions src/utils/load-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function requireCommands () {
update: require('../update'),
version: require('../version'),
types: require('../types'),
resolve: require('../resolve'),
dns: require('../dns')
}

Expand Down
4 changes: 1 addition & 3 deletions test/interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ describe('interface-ipfs-core tests', () => {
{
name: 'should stop the node',
reason: 'FIXME go-ipfs returns an error https://github.com/ipfs/go-ipfs/issues/4078'
},
// resolve
'resolve'
}
]
})

Expand Down

0 comments on commit c7ad0e4

Please sign in to comment.