Restructure Meta.process to logically group code
This commit is contained in:
parent
8d98fdecac
commit
e67ecb5ce2
|
@ -382,6 +382,18 @@ func (m *Meta) process(args []string, vars bool) ([]string, error) {
|
|||
// the args...
|
||||
m.autoKey = ""
|
||||
if vars {
|
||||
var preArgs []string
|
||||
|
||||
if _, err := os.Stat(DefaultVarsFilename); err == nil {
|
||||
m.autoKey = "var-file-default"
|
||||
preArgs = append(preArgs, "-"+m.autoKey, DefaultVarsFilename)
|
||||
}
|
||||
|
||||
if _, err := os.Stat(DefaultVarsFilename + ".json"); err == nil {
|
||||
m.autoKey = "var-file-default"
|
||||
preArgs = append(preArgs, "-"+m.autoKey, DefaultVarsFilename+".json")
|
||||
}
|
||||
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -400,18 +412,6 @@ func (m *Meta) process(args []string, vars bool) ([]string, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var preArgs []string
|
||||
|
||||
if _, err = os.Stat(DefaultVarsFilename); err == nil {
|
||||
m.autoKey = "var-file-default"
|
||||
preArgs = append(preArgs, "-"+m.autoKey, DefaultVarsFilename)
|
||||
}
|
||||
|
||||
if _, err = os.Stat(DefaultVarsFilename + ".json"); err == nil {
|
||||
m.autoKey = "var-file-default"
|
||||
preArgs = append(preArgs, "-"+m.autoKey, DefaultVarsFilename+".json")
|
||||
}
|
||||
|
||||
err = nil
|
||||
for err != io.EOF {
|
||||
var fis []os.FileInfo
|
||||
|
|
Loading…
Reference in New Issue