Explorar o código

如果 tpl 文件存在 便不再进行拷贝,减少idea 的 indexing 的时间

paddy %!s(int64=4) %!d(string=hai) anos
pai
achega
bbdd2dd6c5
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      client/utils.go

+ 5 - 0
client/utils.go

@@ -102,6 +102,11 @@ func copyFile(src, dest string) (w int64, err error) {
 			}
 		}
 	}
+	_, err = os.Stat(dest)
+	if err == nil {
+		fmt.Print("skip copy ", dest)
+		return
+	}
 	dstFile, err := os.Create(dest)
 	if err != nil {
 		fmt.Println(err.Error())