Skip to content

Commit

Permalink
depend on go-ipfs and always use bundled version
Browse files Browse the repository at this point in the history
  • Loading branch information
krl committed May 31, 2015
1 parent 0016bb1 commit 133cfcd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ var shutdown = require('shutdown-handler')
var rimraf = require('rimraf')
var fs = require('fs')

var IPFS_EXEC = __dirname + '/node_modules/.bin/ipfs'

function configureNode (node, conf, cb) {
waterfall(_.map(conf, function (value, key) {
return function () {
var def = Q.defer()
run('ipfs', ['config', key, value], {env: node.env})
run(IPFS_EXEC, ['config', key, value], {env: node.env})
.on('error', cb)
.on('end', function () { def.resolve() })
return def.promise
Expand All @@ -39,7 +41,7 @@ var Node = function (path, opts, disposable) {
var t = this
if (!cb) cb = opts
var buf = ''
run('ipfs', ['init'], {env: t.env})
run(IPFS_EXEC, ['init'], {env: t.env})
.on('error', cb)
.on('data', function (data) { buf += data })
.on('end', function () {
Expand Down Expand Up @@ -69,7 +71,7 @@ var Node = function (path, opts, disposable) {
},
daemon: function (cb) {
var t = this
var running = run('ipfs', ['daemon'], {env: t.env})
var running = run(IPFS_EXEC, ['daemon'], {env: t.env})
t.pid = running.pid
running
.on('error', function (err) {
Expand All @@ -93,7 +95,7 @@ var Node = function (path, opts, disposable) {
getConf: function (key, cb) {
var t = this
var result = ''
run('ipfs', ['config', key], {env: t.env})
run(IPFS_EXEC, ['config', key], {env: t.env})
.on('error', cb)
.on('data', function (data) { result += data })
.on('end', function () { cb(null, result.trim()) })
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ipfsd-ctl",
"version": "0.1.11",
"version": "0.1.12",
"description": "simple controls for an ipfs node",
"main": "index.js",
"scripts": {
Expand All @@ -21,14 +21,15 @@
],
"license": "MIT",
"dependencies": {
"comandante": "0.0.1",
"freeport": "^1.0.5",
"go-ipfs": "^0.3.0",
"ipfs-api": "1.1.7",
"kew": "^0.5.0",
"lodash": "^3.6.0",
"promise-waterfall": "0.1.0",
"kew": "^0.5.0",
"freeport": "^1.0.5",
"shutdown-handler": "^1.0.0",
"rimraf": "2.3.4",
"ipfs-api": "1.1.7",
"comandante": "0.0.1"
"shutdown-handler": "^1.0.0"
},
"devDependencies": {
"mocha": "2.2.5"
Expand Down

0 comments on commit 133cfcd

Please sign in to comment.