mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 08:47:42 +08:00
cat and ls multifile
This commit is contained in:
@ -3,3 +3,6 @@ all: build
|
||||
build:
|
||||
go build
|
||||
mv cli ipfs
|
||||
|
||||
install: build
|
||||
cp ipfs /usr/local/bin/ipfs
|
||||
|
@ -25,13 +25,14 @@ func catCmd(c *commander.Command, inp []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// for now only hashes, no path resolution
|
||||
h, err := mh.FromB58String(inp[0])
|
||||
n, err := localNode()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
n, err := localNode()
|
||||
for _, fn := range inp {
|
||||
// for now only hashes, no path resolution
|
||||
h, err := mh.FromB58String(fn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -42,5 +43,6 @@ func catCmd(c *commander.Command, inp []string) error {
|
||||
}
|
||||
|
||||
u.POut("%s", nd.Data)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -28,13 +28,14 @@ func lsCmd(c *commander.Command, inp []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// for now only hashes, no path resolution
|
||||
h, err := mh.FromB58String(inp[0])
|
||||
n, err := localNode()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
n, err := localNode()
|
||||
for _, fn := range inp {
|
||||
// for now only hashes, no path resolution
|
||||
h, err := mh.FromB58String(fn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -47,5 +48,6 @@ func lsCmd(c *commander.Command, inp []string) error {
|
||||
for _, link := range nd.Links {
|
||||
u.POut("%s %d %s\n", link.Hash.B58String(), link.Size, link.Name)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user