More work on variants
This commit is contained in:
parent
a4fd33cbfd
commit
15b3a154ef
@ -36,7 +36,6 @@ type macro struct {
|
||||
}
|
||||
|
||||
func processCmdMacro(macroName string, args []string, conf *config) error {
|
||||
var found bool
|
||||
for _, mn := range makeVariantNames(macroName, conf.variant) {
|
||||
m, ok := conf.Macros[mn]
|
||||
if !ok {
|
||||
@ -54,11 +53,7 @@ func processCmdMacro(macroName string, args []string, conf *config) error {
|
||||
return processCmd(margs, conf)
|
||||
}
|
||||
|
||||
if !found {
|
||||
return fmt.Errorf("macro or variant not found: %s", macroName)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func processCmd(params []string, conf *config) error {
|
||||
|
17
task.go
17
task.go
@ -67,7 +67,6 @@ func (t *task) process(conf *config) error {
|
||||
}
|
||||
|
||||
func processTask(taskName string, conf *config) error {
|
||||
var found bool
|
||||
for _, tn := range makeVariantNames(taskName, conf.variant) {
|
||||
t, ok := conf.Tasks[tn]
|
||||
if !ok {
|
||||
@ -78,23 +77,17 @@ func processTask(taskName string, conf *config) error {
|
||||
if conf.flags&flagVerbose != 0 {
|
||||
log.Printf("skipping processed task: %s", tn)
|
||||
}
|
||||
} else {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
if conf.flags&flagVerbose != 0 {
|
||||
log.Printf("processing task: %s", tn)
|
||||
}
|
||||
|
||||
conf.handled[tn] = true
|
||||
if err := t.process(conf); err != nil {
|
||||
return err
|
||||
}
|
||||
return t.process(conf)
|
||||
}
|
||||
|
||||
found = true
|
||||
}
|
||||
|
||||
if !found {
|
||||
return fmt.Errorf("task or variant not found: %s", taskName)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user