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:
@ -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",
|
||||
|
Reference in New Issue
Block a user