From 3905c23a6804a1dd627dc8ebca52df9f33f43117 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Mon, 16 Nov 2015 14:35:00 +0100 Subject: [PATCH] restructuring cli --- server/server.js => cli.js | 12 +++++++----- package.json | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) rename server/server.js => cli.js (53%) diff --git a/server/server.js b/cli.js similarity index 53% rename from server/server.js rename to cli.js index a2f5580..44f1e49 100755 --- a/server/server.js +++ b/cli.js @@ -1,17 +1,19 @@ #!/usr/bin/env node +var cli = require('commander') var ipfs = require('ipfs-api')('localhost','5001') var BoardsAPI = require('../lib/boards-api.js') -var BoardsAPIHttp = require('../lib/boards-api-http.js') var boards = new BoardsAPI(ipfs) boards.init(function(err){ if(err){ console.log(err) - } else { - // BoardsAPIHttp(boards) - // setInterval(boards.searchUsers.bind(boards),3 * 60 * 1000) - // boards.searchUsers() } }) + +cli + .version(require('package.json').version) + .description('command line interface for IPFS boards') + +cli.parse(process.argv) diff --git a/package.json b/package.json index 2aab860..3f4217e 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,11 @@ "version": "0.1.0", "description": "decentralized discussion board", "scripts": { - "start": "node server/server.js" + "serve": "gulp serve", + "build": "gulp" }, "bin": { - "ipfs-board": "server/server.js" + "ipfs-board": "cli.js" }, "repository": { "type": "git",