mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
refactor: create inline function inWSLSharedDrive
This commit is contained in:
parent
500cc5834d
commit
21ecfa47e0
|
@ -271,8 +271,11 @@ func (g *git) getStatusColor(defaultValue string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *git) getGitCommandOutput(args ...string) string {
|
func (g *git) getGitCommandOutput(args ...string) string {
|
||||||
|
inWSLSharedDrive := func(env environmentInfo) bool {
|
||||||
|
return env.isWsl() && strings.HasPrefix(env.getcwd(), "/mnt/")
|
||||||
|
}
|
||||||
gitCommand := "git"
|
gitCommand := "git"
|
||||||
if g.env.getRuntimeGOOS() == windowsPlatform || (g.env.isWsl() && strings.HasPrefix(g.env.getcwd(), "/mnt/")) {
|
if g.env.getRuntimeGOOS() == windowsPlatform || inWSLSharedDrive(g.env) {
|
||||||
gitCommand = "git.exe"
|
gitCommand = "git.exe"
|
||||||
}
|
}
|
||||||
args = append([]string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...)
|
args = append([]string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...)
|
||||||
|
|
Loading…
Reference in a new issue