Skip to content

Commit

Permalink
disable prompts flag for codegen (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto authored Jul 14, 2022
1 parent 27e340f commit fccd357
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tsent/cmd/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var codegenCmd = &cobra.Command{
if rootInfo.debug {
opts = append(opts, codegen.DebugMode())
}

if codegenInfo.writeAll {
opts = append(opts, codegen.WriteAll())
}
Expand All @@ -80,6 +81,9 @@ var codegenCmd = &cobra.Command{
if codegenInfo.disableCustomGraphQL {
opts2 = append(opts2, codegen.DisableCustomGraphQL())
}
if rootInfo.disablePrompts {
opts2 = append(opts2, codegen.DisablePrompts())
}
return processor.Run(steps, codegenInfo.step, opts2...)
},
}
4 changes: 3 additions & 1 deletion tsent/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ var rootCmd = &cobra.Command{
}

type rootArgs struct {
debug bool
debug bool
disablePrompts bool
}

var rootInfo rootArgs
Expand Down Expand Up @@ -91,6 +92,7 @@ func init() {
})

rootCmd.PersistentFlags().BoolVar(&rootInfo.debug, "debug", false, "debug mode. add debug information to codegen e.g. files written etc")
rootCmd.PersistentFlags().BoolVar(&rootInfo.disablePrompts, "disable_prompts", false, "disable prompts")

codegenCmd.Flags().StringVarP(&codegenInfo.step, "step", "s", "", "limit to only run a particular step e.g. db, graphql, codegen")
codegenCmd.Flags().BoolVar(&codegenInfo.writeAll, "write-all", false, "to force writing all files and skip the logic we have for only selectively writing some files")
Expand Down

0 comments on commit fccd357

Please sign in to comment.