refactoring

This commit is contained in:
Chris Lu committed 2020-04-05 13:11:43 -07:00
1 parent 2d43f85577
commit 91da7057b1
9 files changed
+21 -21

No files matched your search

+1 -2
View File
@@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"path/filepath"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
@@ -65,7 +64,7 @@ func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer
// moving a file or folder
if err == nil && respDestinationLookupEntry.Entry.IsDirectory {
// to a directory
targetDir = filepath.ToSlash(filepath.Join(destinationDir, destinationName))
targetDir = util.Join(destinationDir, destinationName)
targetName = sourceName
} else {
// to a file or folder
+1 -2
View File
@@ -4,7 +4,6 @@ import (
"fmt"
"io"
"net/url"
"path/filepath"
"strconv"
"strings"
@@ -55,7 +54,7 @@ func (ce *CommandEnv) parseUrl(input string) (path string, err error) {
return
}
if !strings.HasPrefix(input, "/") {
input = filepath.ToSlash(filepath.Join(ce.option.Directory, input))
input = util.Join(ce.option.Directory, input)
}
return input, err
}