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

fix: re-allow passing path to ls #914

Merged
merged 2 commits into from
Dec 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"eslint-plugin-react": "^7.11.1",
"go-ipfs-dep": "~0.4.18",
"gulp": "^3.9.1",
"interface-ipfs-core": "~0.92.0",
"interface-ipfs-core": "~0.93.0",
"ipfsd-ctl": "~0.40.0",
"nock": "^10.0.2",
"pull-stream": "^3.6.9",
Expand Down
5 changes: 4 additions & 1 deletion src/files-regular/ls-pull-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const moduleConfig = require('../utils/module-config')
const pull = require('pull-stream')
const deferred = require('pull-defer')
const IsIpfs = require('is-ipfs')
const cleanCID = require('../utils/clean-cid')

module.exports = (arg) => {
Expand All @@ -17,7 +18,9 @@ module.exports = (arg) => {
try {
args = cleanCID(args)
} catch (err) {
return callback(err)
if (!IsIpfs.ipfsPath(args)) {
return callback(err)
}
}

const p = deferred.source()
Expand Down
5 changes: 4 additions & 1 deletion src/files-regular/ls-readable-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const moduleConfig = require('../utils/module-config')
const Stream = require('readable-stream')
const IsIpfs = require('is-ipfs')
const cleanCID = require('../utils/clean-cid')

module.exports = (arg) => {
Expand All @@ -16,7 +17,9 @@ module.exports = (arg) => {
try {
args = cleanCID(args)
} catch (err) {
return callback(err)
if (!IsIpfs.ipfsPath(args)) {
return callback(err)
}
}

const pt = new Stream.PassThrough({ objectMode: true })
Expand Down
5 changes: 4 additions & 1 deletion src/files-regular/ls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const promisify = require('promisify-es6')
const IsIpfs = require('is-ipfs')
const moduleConfig = require('../utils/module-config')
const cleanCID = require('../utils/clean-cid')

Expand All @@ -16,7 +17,9 @@ module.exports = (arg) => {
try {
args = cleanCID(args)
} catch (err) {
return callback(err)
if (!IsIpfs.ipfsPath(args)) {
return callback(err)
}
}

send({
Expand Down