Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Added checking of interval flags when using WF Manifest via snapctl t…
Browse files Browse the repository at this point in the history
…o give a better error.
  • Loading branch information
IRCody committed Feb 10, 2016
1 parent be3b178 commit fa14f5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/snapctl/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ func createTaskUsingWFManifest(ctx *cli.Context) {
path := ctx.String("workflow-manifest")
ext := filepath.Ext(path)
file, e := ioutil.ReadFile(path)

if !ctx.IsSet("interval") && !ctx.IsSet("i") {
fmt.Println("Workflow manifest requires interval to be set via flag.")
os.Exit(1)
}
if e != nil {
fmt.Printf("File error [%s]- %v\n", ext, e)
os.Exit(1)
Expand All @@ -186,7 +191,6 @@ func createTaskUsingWFManifest(ctx *cli.Context) {
}
// Get the task name
name := ctx.String("name")

// Get the interval
i := ctx.String("interval")
_, err := time.ParseDuration(i)
Expand Down

0 comments on commit fa14f5f

Please sign in to comment.