Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
there is no cat
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Sep 12, 2016
1 parent 3e4e2fd commit 4e61958
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/cli/commands/files/cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ module.exports = {

handler (argv) {
const path = argv['ipfs-path']

utils.getIPFS((err, ipfs) => {
if (err) {
throw err
}

ipfs.files.cat(path, (err, file) => {
if (err) {
throw (err)
}
if (utils.isDaemonOn()) {
return ipfs.cat(path, onFile)
}

file.pipe(process.stdout)
})
ipfs.files.cat(path, onFile)
})
}
}

function onFile (err, file) {
if (err) {
throw (err)
}
file.pipe(process.stdout)
}

0 comments on commit 4e61958

Please sign in to comment.