`ipfs key rm` & `ipfs name publish` error out on empty stdin rather than doing nothing
#4 904 ouverte le 1 avr. 2018
Métriques du dépôt
- Stars
- (13 906 stars)
- Métriques de merge PR
- (Merge moyen 4j 2h) (28 PRs mergées en 30 j)
Description
Version information:
go-ipfs version: 0.4.13- Repo version: 6 System version: amd64/linux Golang version: go1.9.4
Type:
Bug
Description:
ipfs key rm and ipfs name publish (and probably other ipfs commands) will, if invoked with no positional arguments, expect input from stdin, presumably so you can pipe in the output of other ipfs commands without needing to faff around with xargs.
The problem is that when input is empty, these commands fail:
$ ipfs name publish </dev/null
ipfs: Reading from /dev/stdin; send Ctrl-d to stop.
Error: invalid 'ipfs ref' path
$ ipfs key rm </dev/null
ipfs: Reading from /dev/stdin; send Ctrl-d to stop.
Error: invalid 'ipfs ref' path
Which is a problem when (as is often the case) the command generating the input may legitimately produce empty input, e.g. ipfs key list | grep remove-me | ipfs key rm.