From dcd3bb6bbde338715cb7ce249c88396fa2a97fe6 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 17 Aug 2018 11:13:21 +1000 Subject: [PATCH] use platform independent command to remove a file or directory --- pkg/commands/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 44fd57f1c..3349e4860 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -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)