1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-09 13:47:11 +02:00

Only read env once when recording dirs

This commit is contained in:
David Roman 2022-03-16 14:07:48 +01:00 committed by Jesse Duffield
parent b8fc829f86
commit d8d0d4686d

View File

@ -20,10 +20,11 @@ func (gui *Gui) recordCurrentDirectory() error {
}
func (gui *Gui) recordDirectory(dirName string) error {
if os.Getenv("LAZYGIT_NEW_DIR_FILE") == "" {
newDirFilePath := os.Getenv("LAZYGIT_NEW_DIR_FILE")
if newDirFilePath == "" {
return nil
}
return gui.OSCommand.CreateFileWithContent(os.Getenv("LAZYGIT_NEW_DIR_FILE"), dirName)
return gui.OSCommand.CreateFileWithContent(newDirFilePath, dirName)
}
func (gui *Gui) handleQuitWithoutChangingDirectory() error {