1
0
mirror of https://github.com/go-task/task.git synced 2025-12-01 22:52:02 +02:00

refactor: decouple fingerprinting from executor (#1039)

This commit is contained in:
Pete Davison
2023-03-10 18:27:30 +00:00
committed by GitHub
parent c64f8818be
commit 0838d48ee3
24 changed files with 734 additions and 241 deletions

View File

@@ -0,0 +1,16 @@
package fingerprint
import "fmt"
func NewSourcesChecker(method, tempDir string, dry bool) (SourcesCheckable, error) {
switch method {
case "timestamp":
return NewTimestampChecker(tempDir, dry), nil
case "checksum":
return NewChecksumChecker(tempDir, dry), nil
case "none":
return NoneChecker{}, nil
default:
return nil, fmt.Errorf(`task: invalid method "%s"`, method)
}
}