修复无法自动创建 .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
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,