From dd3fe88e4844488fdf9e3b2fa841017e2a5cdabb Mon Sep 17 00:00:00 2001 From: Victor Bjelkholm Date: Sat, 10 Sep 2016 18:14:50 +0200 Subject: [PATCH] fix(cli): use right argument for cli .cat Add tests for making sure .cat shows right output and fix that test by using the right argument from cli. Ref: issue #476 --- src/cli/commands/files/cat.js | 2 +- test/cli/test-files.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/files/cat.js b/src/cli/commands/files/cat.js index 7129aeed66..34737439ae 100644 --- a/src/cli/commands/files/cat.js +++ b/src/cli/commands/files/cat.js @@ -13,7 +13,7 @@ module.exports = { builder: {}, handler (argv) { - const path = argv.ipfsPath + const path = argv['ipfs-path'] utils.getIPFS((err, ipfs) => { if (err) { throw err diff --git a/test/cli/test-files.js b/test/cli/test-files.js index ffe0a5ae78..a9a5bf68cb 100644 --- a/test/cli/test-files.js +++ b/test/cli/test-files.js @@ -17,6 +17,7 @@ describe('files', () => { .run((err, stdout, exitcode) => { expect(err).to.not.exist expect(exitcode).to.equal(0) + expect(stdout[0]).to.equal('hello world') done() }) })