打包优化
This commit is contained in:
parent
2aa01962a3
commit
3ec57b7ba0
8
main.go
8
main.go
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue