Should use filepath instead of pathx.

This commit is contained in:
Andrey Parhomenko 2023-03-30 10:13:49 +03:00
parent 7b24de683b
commit fab51f61ac
2 changed files with 6 additions and 5 deletions
src/tool
mkdir
paths

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/surdeus/goblin/src/pathx" "path/filepath"
"github.com/surdeus/gomtool/src/mtool" "github.com/surdeus/gomtool/src/mtool"
) )
@ -24,7 +24,7 @@ func Run(flagSet *mtool.Flags) {
mode := os.FileMode(modeArg) mode := os.FileMode(modeArg)
for _, path := range args { for _, path := range args {
var e error var e error
pth := pathx.From(path).Real() pth := filepath.FromSlash(path)
if parentFlag { if parentFlag {
e = os.MkdirAll(pth, mode) e = os.MkdirAll(pth, mode)
} else { } else {

View file

@ -9,7 +9,8 @@ import (
"path" "path"
"strings" "strings"
"github.com/surdeus/goblin/src/pathx" //"github.com/surdeus/goblin/src/pathx"
"path/filepath"
"github.com/surdeus/gomtool/src/mtool" "github.com/surdeus/gomtool/src/mtool"
) )
@ -30,7 +31,7 @@ var (
func handlePath(p string) { func handlePath(p string) {
if fromReal { if fromReal {
p = pathx.FromReal(p).String() p = filepath.ToSlash(p)
} }
if handler != nil { if handler != nil {
p = handler(p) p = handler(p)
@ -38,7 +39,7 @@ func handlePath(p string) {
var toPrint string var toPrint string
if r { if r {
toPrint = pathx.From(p).Real() toPrint = filepath.FromSlash(p)
} else { } else {
toPrint = p toPrint = p
} }