打包优化

This commit is contained in:
zhucheer 2019-12-28 23:26:56 +08:00
parent 2aa01962a3
commit 3ec57b7ba0
1 changed files with 1 additions and 7 deletions

View File

@ -56,7 +56,7 @@ func buildProject() {
//移动静态文件
CopyPath("config"+dirDot(), "build"+dirDot()+"config")
CopyPath("storage"+dirDot(), "build"+dirDot()+"storage")
fmt.Println("build success")
}
// linux下编译打包
@ -69,7 +69,6 @@ func buildProjectWithLinux(){
return
}
projectName := pwdArr[len(pwdArr)-1]
fmt.Println("====", projectName)
execShell( fmt.Sprintf("go build -o build/%s.exe", projectName))
}
@ -260,13 +259,8 @@ func CopyPath(src, dst string) bool {
if err != nil {
panic(err)
}
relationPath := strings.Replace(path, src, dirDot(), -1)
fmt.Println(path, src)
dstPath := strings.TrimRight(strings.TrimRight(dst, "/"), "\\") + relationPath
if !info.IsDir() {
if CopyFile(path, dstPath) {
return nil