aboutsummaryrefslogtreecommitdiff
path: root/weed/shell
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-05 13:11:43 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-05 13:11:43 -0700
commit91da7057b1e4e0a623e2c2d273cce4a1426e69c1 (patch)
tree75bdd6b586bc4c23dfc567461e16d5c2d4583e21 /weed/shell
parent2d43f85577cb998656abf2525445b72fcd8cc48d (diff)
downloadseaweedfs-91da7057b1e4e0a623e2c2d273cce4a1426e69c1.tar.xz
seaweedfs-91da7057b1e4e0a623e2c2d273cce4a1426e69c1.zip
refactoring
Diffstat (limited to 'weed/shell')
-rw-r--r--weed/shell/command_fs_mv.go3
-rw-r--r--weed/shell/commands.go3
2 files changed, 2 insertions, 4 deletions
diff --git a/weed/shell/command_fs_mv.go b/weed/shell/command_fs_mv.go
index c7c0984fc..0a7eed02d 100644
--- a/weed/shell/command_fs_mv.go
+++ b/weed/shell/command_fs_mv.go
@@ -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
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index 06b46b774..41f197328 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -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
}