修复无法自动创建 .gitignore问题

This commit is contained in:
白茶清欢 2022-06-14 22:40:38 +08:00
parent 670c5b1466
commit d5e1721d1f

15
git.go
View File

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