mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
use platform independent command to remove a file or directory
This commit is contained in:
parent
bd15f9d27a
commit
dcd3bb6bbd
1 changed files with 1 additions and 1 deletions
|
@ -359,7 +359,7 @@ func (c *GitCommand) IsInMergeState() (bool, error) {
|
||||||
func (c *GitCommand) RemoveFile(file File) error {
|
func (c *GitCommand) RemoveFile(file File) error {
|
||||||
// if the file isn't tracked, we assume you want to delete it
|
// if the file isn't tracked, we assume you want to delete it
|
||||||
if !file.Tracked {
|
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
|
// if the file is tracked, we assume you want to just check it out
|
||||||
return c.OSCommand.RunCommand("git checkout " + file.Name)
|
return c.OSCommand.RunCommand("git checkout " + file.Name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue