Skip to content

Commit

Permalink
cat: revert change to 'not a directory' error (interop)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
  • Loading branch information
Stebalien committed Feb 19, 2019
1 parent a356aeb commit 229f5f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/commands/cat.go
Expand Up @@ -128,8 +128,14 @@ func cat(ctx context.Context, api iface.CoreAPI, paths []string, offset int64, m
return nil, 0, err
}

file, ok := f.(files.File)
if !ok {
var file files.File
switch f := f.(type) {
case files.File:
file = f
case files.Directory:
return nil, 0, iface.ErrIsDir
default:
// TODO: Consider returning "error not supported" for symlinks.
return nil, 0, iface.ErrNotFile
}

Expand Down

0 comments on commit 229f5f3

Please sign in to comment.