mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
fix could-not-access error
This commit is contained in:
parent
ab03cf8bcf
commit
e8b97c9fe2
22 changed files with 80 additions and 1 deletions
|
@ -45,6 +45,15 @@ func (s *Shell) CreateFile(path string, content string) *Shell {
|
|||
return s
|
||||
}
|
||||
|
||||
func (s *Shell) CreateDir(path string) *Shell {
|
||||
fullPath := filepath.Join(s.dir, path)
|
||||
if err := os.MkdirAll(fullPath, 0o755); err != nil {
|
||||
panic(fmt.Sprintf("error creating directory: %s\n%s", fullPath, err))
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Shell) UpdateFile(path string, content string) *Shell {
|
||||
fullPath := filepath.Join(s.dir, path)
|
||||
err := os.WriteFile(fullPath, []byte(content), 0o644)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue