feat: fix permission problem of temp dirs

This commit is contained in:
Ryooooooga 2022-04-01 23:38:41 +09:00 committed by Jesse Duffield
parent 2fbb52fa2c
commit 86c259623c
7 changed files with 26 additions and 12 deletions

View file

@ -251,7 +251,7 @@ func (self *WorkingTreeCommands) WorktreeFileDiffCmdObj(node models.IFile, plain
}
func (self *WorkingTreeCommands) ApplyPatch(patch string, flags ...string) error {
filepath := filepath.Join(oscommands.GetTempDir(), utils.GetCurrentRepoName(), time.Now().Format("Jan _2 15.04.05.000000000")+".patch")
filepath := filepath.Join(self.os.GetTempDir(), utils.GetCurrentRepoName(), time.Now().Format("Jan _2 15.04.05.000000000")+".patch")
self.Log.Infof("saving temporary patch to %s", filepath)
if err := self.os.CreateFileWithContent(filepath, patch); err != nil {
return err