mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-20 21:14:25 +02:00
simplify parsing filer host and port
This commit is contained in:
1 parent
d151185b7e
commit
e666aeece2
14 files changed
+44
-99
No files matched your search
@@ -30,20 +30,18 @@ func (c *commandFsCat) Help() string {
|
||||
|
||||
func (c *commandFsCat) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
|
||||
|
||||
input := findInputDirectory(args)
|
||||
|
||||
filerServer, filerPort, path, err := commandEnv.parseUrl(input)
|
||||
path, err := commandEnv.parseUrl(findInputDirectory(args))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if commandEnv.isDirectory(filerServer, filerPort, path) {
|
||||
if commandEnv.isDirectory(path) {
|
||||
return fmt.Errorf("%s is a directory", path)
|
||||
}
|
||||
|
||||
dir, name := util.FullPath(path).DirAndName()
|
||||
|
||||
return commandEnv.withFilerClient(filerServer, filerPort, func(client filer_pb.SeaweedFilerClient) error {
|
||||
return commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
||||
|
||||
request := &filer_pb.LookupDirectoryEntryRequest{
|
||||
Name: name,
|
||||
|
||||
Reference in new issue
Block a user