1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-25 05:37:37 +03:00

more work on rebasing including visual indicators

This commit is contained in:
Jesse Duffield
2018-12-05 22:30:10 +11:00
parent cce6f405a5
commit e0ff46fe53
10 changed files with 221 additions and 51 deletions

View File

@@ -202,3 +202,14 @@ func (c *OSCommand) CreateTempFile(filename, content string) (string, error) {
func (c *OSCommand) RemoveFile(filename string) error {
return os.Remove(filename)
}
// FileExists checks whether a file exists at the specified path
func (c *OSCommand) FileExists(path string) (bool, error) {
if _, err := os.Stat(path); err != nil {
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
return true, nil
}