|
|
@ -37,7 +37,6 @@ func kratosHomeWithDir(dir string) string { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func copyFile(src, dst string, replaces []string) error { |
|
|
|
func copyFile(src, dst string, replaces []string) error { |
|
|
|
var err error |
|
|
|
|
|
|
|
srcinfo, err := os.Stat(src) |
|
|
|
srcinfo, err := os.Stat(src) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
@ -58,19 +57,18 @@ func copyFile(src, dst string, replaces []string) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func copyDir(src, dst string, replaces, ignores []string) error { |
|
|
|
func copyDir(src, dst string, replaces, ignores []string) error { |
|
|
|
var err error |
|
|
|
srcinfo, err := os.Stat(src) |
|
|
|
var fds []os.DirEntry |
|
|
|
if err != nil { |
|
|
|
var srcinfo os.FileInfo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if srcinfo, err = os.Stat(src); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if err = os.MkdirAll(dst, srcinfo.Mode()); err != nil { |
|
|
|
err = os.MkdirAll(dst, srcinfo.Mode()) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if fds, err = os.ReadDir(src); err != nil { |
|
|
|
fds, err := os.ReadDir(src) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
for _, fd := range fds { |
|
|
|
for _, fd := range fds { |
|
|
|