mirror of
https://github.com/go-task/task.git
synced 2026-07-08 14:35:18 +00:00
cache dymanic variables
This commit is contained in:
@@ -26,6 +26,12 @@ func (e *Executor) handleDynamicVariableContent(value string) (string, error) {
|
||||
return value, nil
|
||||
}
|
||||
|
||||
e.muDynamicCache.Lock()
|
||||
defer e.muDynamicCache.Unlock()
|
||||
if result, ok := e.dynamicCache[value]; ok {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
buff := bytes.NewBuffer(nil)
|
||||
|
||||
opts := &execext.RunCommandOptions{
|
||||
@@ -46,6 +52,7 @@ func (e *Executor) handleDynamicVariableContent(value string) (string, error) {
|
||||
|
||||
result = strings.TrimSpace(result)
|
||||
e.verbosePrintfln(`task: dynamic variable: "%s", result: "%s"`, value, result)
|
||||
e.dynamicCache[value] = result
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user