Minor refactoring

This commit is contained in:
Junegunn Choi 2024-07-27 18:58:23 +09:00
parent 587df594b8
commit b99d884e57
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -148,18 +148,20 @@ func Run(opts *Options) (int, error) {
// Terminal I/O // Terminal I/O
var terminal *Terminal var terminal *Terminal
var err error
var initialEnv []string var initialEnv []string
initialReload := opts.extractReloadOnStart() initialReload := opts.extractReloadOnStart()
if opts.Filter == nil { if opts.Filter == nil {
var err error
terminal, err = NewTerminal(opts, eventBox, executor) terminal, err = NewTerminal(opts, eventBox, executor)
if err != nil { if err != nil {
return ExitError, err return ExitError, err
} }
initialEnv = terminal.environ() if len(initialReload) > 0 {
var temps []string var temps []string
initialReload, temps = terminal.replacePlaceholderInInitialCommand(initialReload) initialReload, temps = terminal.replacePlaceholderInInitialCommand(initialReload)
defer removeFiles(temps) initialEnv = terminal.environ()
defer removeFiles(temps)
}
} }
// Reader // Reader