1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-23 00:39:13 +02:00

Platform should only be present once

This commit is contained in:
Andrei Miulescu
2018-08-14 12:24:32 +10:00
parent c0a1f90604
commit 842ceec9b0
2 changed files with 7 additions and 34 deletions

View File

@ -19,7 +19,7 @@ var (
)
// Platform stores the os state
type platform struct {
type Platform struct {
os string
shell string
shellArg string
@ -29,7 +29,7 @@ type platform struct {
// OSCommand holds all the os commands
type OSCommand struct {
Log *logrus.Logger
Platform platform
Platform *Platform
}
// NewOSCommand os command runner
@ -67,17 +67,17 @@ func sanitisedCommandOutput(output []byte, err error) (string, error) {
return outputString, err
}
func getPlatform() platform {
func getPlatform() *Platform {
switch runtime.GOOS {
case "windows":
return platform{
return &Platform{
os: "windows",
shell: "cmd",
shellArg: "/c",
escapedQuote: "\\\"",
}
default:
return platform{
return &Platform{
os: runtime.GOOS,
shell: "bash",
shellArg: "-c",