mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-11 22:38:53 +01: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,25 +30,19 @@ func (c *commandFsCd) Help() string {
|
||||
|
||||
func (c *commandFsCd) 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 path == "/" {
|
||||
commandEnv.option.FilerHost = filerServer
|
||||
commandEnv.option.FilerPort = filerPort
|
||||
commandEnv.option.Directory = "/"
|
||||
return nil
|
||||
}
|
||||
|
||||
err = commandEnv.checkDirectory(filerServer, filerPort, path)
|
||||
err = commandEnv.checkDirectory(path)
|
||||
|
||||
if err == nil {
|
||||
commandEnv.option.FilerHost = filerServer
|
||||
commandEnv.option.FilerPort = filerPort
|
||||
commandEnv.option.Directory = path
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user