Browse Source

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

paddy 4 năm trước cách đây
mục cha
commit
bbdd2dd6c5
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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())