mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-24 21:57:36 +00:00
Minor refactoring
This commit is contained in:
parent
587df594b8
commit
b99d884e57
12
src/core.go
12
src/core.go
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user