1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-09 13:47:11 +02:00

use platform independent command to remove a file or directory

This commit is contained in:
Jesse Duffield 2018-08-17 11:13:21 +10:00
parent bd15f9d27a
commit dcd3bb6bbd

View File

@ -359,7 +359,7 @@ func (c *GitCommand) IsInMergeState() (bool, error) {
func (c *GitCommand) RemoveFile(file File) error {
// if the file isn't tracked, we assume you want to delete it
if !file.Tracked {
return c.OSCommand.RunCommand("rm -rf ./" + file.Name)
return os.RemoveAll(file.Name)
}
// if the file is tracked, we assume you want to just check it out
return c.OSCommand.RunCommand("git checkout " + file.Name)