diff --git a/git.go b/git.go index b24bb5d..8243b09 100644 --- a/git.go +++ b/git.go @@ -7,7 +7,11 @@ // Date : 2022-06-14 20:02 package command -import "git.zhangdeman.cn/zhangdeman/command/define" +import ( + "os" + + "git.zhangdeman.cn/zhangdeman/command/define" +) // Git ... // @@ -139,10 +143,11 @@ release } // 将信息写入文件 return &define.Result{ - WorkDir: g.workDir, - CmdPath: "", - Param: nil, - Error: File(g.workDir, ".gitignore").Write([]byte(baseFileContent)), + WorkDir: g.workDir, + CmdPath: "", + Param: nil, + Error: File(g.workDir, ".gitignore").AutoCreate().SetClearHasContentForWrite(). + SetOpenFlag(os.O_TRUNC, os.O_RDWR, os.O_CREATE).Write([]byte(baseFileContent)), Output: nil, StartTime: 0, FinishTime: 0,