1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-22 06:52:19 +03:00

Cleanup: move UpdateWindowTitle to platform-specific source files

No need to do a runtime check if we already have the platform-specific files.
This commit is contained in:
Stefan Haller
2025-08-08 20:12:05 +02:00
parent 77a9207f9e
commit e5acbed848
3 changed files with 19 additions and 13 deletions

View File

@@ -1,5 +1,11 @@
package oscommands
import (
"fmt"
"os"
"path/filepath"
)
func GetPlatform() *Platform {
return &Platform{
OS: "windows",
@@ -7,3 +13,12 @@ func GetPlatform() *Platform {
ShellArg: "/c",
}
}
func (c *OSCommand) UpdateWindowTitle() error {
path, getWdErr := os.Getwd()
if getWdErr != nil {
return getWdErr
}
argString := fmt.Sprint("title ", filepath.Base(path), " - Lazygit")
return c.Cmd.NewShell(argString, c.UserConfig().OS.ShellFunctionsFile).Run()
}