@@ -78,7 +78,7 @@ func TriggerGenerate(ctx context.Context, clients *shared.ClientFactory, app typ
7878 },
7979 })))
8080
81- triggerFilePaths , err := getFullyQualifiedTriggerFilePaths (clients , triggerPaths )
81+ triggerFilePaths , err := getFullyQualifiedTriggerFilePaths (ctx , clients , triggerPaths )
8282 if err != nil {
8383 return nil , err
8484 }
@@ -171,8 +171,7 @@ func getTriggerPaths(sdkCLIConfig *hooks.SDKCLIConfig) []string {
171171
172172// getFullyQualifiedTriggerFilePaths returns an array of file paths that
173173// are validated
174- func getFullyQualifiedTriggerFilePaths (clients * shared.ClientFactory , triggerPaths []string ) ([]string , error ) {
175- ctx := context .Background ()
174+ func getFullyQualifiedTriggerFilePaths (ctx context.Context , clients * shared.ClientFactory , triggerPaths []string ) ([]string , error ) {
176175 projectDir , err := clients .Os .Getwd ()
177176 if err != nil {
178177 return nil , err
@@ -239,7 +238,7 @@ func isValidTriggerFilePath(triggerPath string) bool {
239238 return true
240239}
241240
242- func validateCreateCmdFlags (clients * shared.ClientFactory , createFlags * createCmdFlags ) error {
241+ func validateCreateCmdFlags (ctx context. Context , clients * shared.ClientFactory , createFlags * createCmdFlags ) error {
243242 if createFlags .triggerDef != "" {
244243 exists , err := afero .Exists (clients .Fs , createFlags .triggerDef )
245244 if err != nil {
@@ -280,7 +279,7 @@ func validateCreateCmdFlags(clients *shared.ClientFactory, createFlags *createCm
280279 }
281280
282281 if createFlags .triggerDef == "" && createFlags .workflow == "" {
283- return maybeSetTriggerDefFlag (clients , createFlags )
282+ return maybeSetTriggerDefFlag (ctx , clients , createFlags )
284283 }
285284
286285 if createFlags .description == "" {
@@ -290,16 +289,15 @@ func validateCreateCmdFlags(clients *shared.ClientFactory, createFlags *createCm
290289 return nil
291290}
292291
293- func maybeSetTriggerDefFlag (clients * shared.ClientFactory , createFlags * createCmdFlags ) error {
294- ctx := context .Background ()
292+ func maybeSetTriggerDefFlag (ctx context.Context , clients * shared.ClientFactory , createFlags * createCmdFlags ) error {
295293 triggerPaths := getTriggerPaths (& clients .SDKConfig )
296294
297295 fmt .Printf ("%s" , style .Sectionf (style.TextSection {
298296 Emoji : "zap" ,
299297 Text : fmt .Sprintf ("Searching for trigger definition files under '%s'..." , strings .Join (triggerPaths , ", " )),
300298 }))
301299
302- triggerFilePaths , err := getFullyQualifiedTriggerFilePaths (clients , triggerPaths )
300+ triggerFilePaths , err := getFullyQualifiedTriggerFilePaths (ctx , clients , triggerPaths )
303301 if err != nil {
304302 return err
305303 }
0 commit comments