Add flagNoMacro guard

This commit is contained in:
Alex Yatskov 2015-07-20 13:57:37 +09:00
parent c4624d7c0b
commit f35909340b

26
task.go
View File

@ -50,21 +50,23 @@ func (t *taskDef) process(taskName, srcDir, dstDir string, conf *config, flags i
} }
} }
for _, macro := range t.Macros { if flags&flagNoMacro == 0 {
if len(macro) == 0 { for _, macro := range t.Macros {
continue if len(macro) == 0 {
} continue
}
macroName := macro[0] macroName := macro[0]
macroParams := macro[1:] macroParams := macro[1:]
depMacro, ok := conf.Macros[macroName] depMacro, ok := conf.Macros[macroName]
if !ok { if !ok {
return fmt.Errorf("macro dependency not found %s", macroName) return fmt.Errorf("macro dependency not found %s", macroName)
} }
if err := depMacro.process(dstDir, macroParams, flags); err != nil { if err := depMacro.process(dstDir, macroParams, flags); err != nil {
return err return err
}
} }
} }