Only read env once when recording dirs
This commit is contained in:
committed by
Jesse Duffield
parent
b8fc829f86
commit
d8d0d4686d
@@ -20,10 +20,11 @@ func (gui *Gui) recordCurrentDirectory() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) recordDirectory(dirName string) 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 nil
|
||||||
}
|
}
|
||||||
return gui.OSCommand.CreateFileWithContent(os.Getenv("LAZYGIT_NEW_DIR_FILE"), dirName)
|
return gui.OSCommand.CreateFileWithContent(newDirFilePath, dirName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleQuitWithoutChangingDirectory() error {
|
func (gui *Gui) handleQuitWithoutChangingDirectory() error {
|
||||||
|
|||||||
Reference in New Issue
Block a user