refactor: create inline function inWSLSharedDrive

This commit is contained in:
Vincent Bourdon 2021-03-10 22:10:35 +01:00 committed by Jan De Dobbeleer
parent 21ecfa47e0
commit 7984365f1d

View file

@ -272,8 +272,8 @@ func (g *git) getStatusColor(defaultValue string) string {
func (g *git) getGitCommandOutput(args ...string) string {
inWSLSharedDrive := func(env environmentInfo) bool {
return env.isWsl() && strings.HasPrefix(env.getcwd(), "/mnt/")
}
return env.isWsl() && strings.HasPrefix(env.getcwd(), "/mnt/")
}
gitCommand := "git"
if g.env.getRuntimeGOOS() == windowsPlatform || inWSLSharedDrive(g.env) {
gitCommand = "git.exe"