Skip to content

Commit

Permalink
Merge pull request #109 from TIBCOSoftware/check-shim-exists
Browse files Browse the repository at this point in the history
Print proper error if trigger doesn't exist
  • Loading branch information
retgits authored Jun 1, 2018
2 parents a427716 + fb29124 commit 1855abb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ func doPrepare(env env.Project, options *PrepareOptions) (err error) {

fmt.Println("Shim:", options.Shim)

for _, value := range descriptor.Triggers {
found := false

fmt.Println("Id:", value.Id)
for _, value := range descriptor.Triggers {
if value.Id == options.Shim {
found = true
triggerPath := filepath.Join(env.GetVendorSrcDir(), value.Ref, "trigger.json")

mdJson, err := fgutil.LoadLocalFile(triggerPath)
Expand Down Expand Up @@ -291,6 +292,12 @@ func doPrepare(env env.Project, options *PrepareOptions) (err error) {
}
}

if !found {
fmt.Printf("\nCan't locate trigger with id [%s] in flogo.json\n", options.Shim)
fmt.Printf("Please check if you have specified the correct trigger id\n\n")
os.Exit(2)
}

} else if options.EmbedConfig {
createEmbeddedAppGoFile(env.GetAppDir(), appJson)
}
Expand Down

0 comments on commit 1855abb

Please sign in to comment.