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:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user