mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
feat(remote): add a command to clear the cache (#1639)
* feat(remote): add a command to clear the cache * Update cmd/task/task.go Co-authored-by: Andrey Nering <andrey@nering.com.br> * rebase --------- Co-authored-by: Andrey Nering <andrey@nering.com.br>
This commit is contained in:
@@ -65,6 +65,7 @@ var (
|
||||
Experiments bool
|
||||
Download bool
|
||||
Offline bool
|
||||
ClearCache bool
|
||||
Timeout time.Duration
|
||||
)
|
||||
|
||||
@@ -119,6 +120,7 @@ func init() {
|
||||
pflag.BoolVar(&Download, "download", false, "Downloads a cached version of a remote Taskfile.")
|
||||
pflag.BoolVar(&Offline, "offline", false, "Forces Task to only use local or cached Taskfiles.")
|
||||
pflag.DurationVar(&Timeout, "timeout", time.Second*10, "Timeout for downloading remote Taskfiles.")
|
||||
pflag.BoolVar(&ClearCache, "clear-cache", false, "Clear the remote cache.")
|
||||
}
|
||||
|
||||
pflag.Parse()
|
||||
@@ -129,6 +131,10 @@ func Validate() error {
|
||||
return errors.New("task: You can't set both --download and --offline flags")
|
||||
}
|
||||
|
||||
if Download && ClearCache {
|
||||
return errors.New("task: You can't set both --download and --clear-cache flags")
|
||||
}
|
||||
|
||||
if Global && Dir != "" {
|
||||
log.Fatal("task: You can't set both --global and --dir")
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user