We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 667b577 commit e2c6056Copy full SHA for e2c6056
internal/cmd/cmd.go
@@ -62,8 +62,11 @@ var initCmd = &cobra.Command{
62
Short: "Create an empty sqlc.yaml settings file",
63
RunE: func(cmd *cobra.Command, args []string) error {
64
file := "sqlc.yaml"
65
- if f := cmd.Flag("file"); f != nil {
+ if f := cmd.Flag("file"); f != nil && f.Changed {
66
file = f.Value.String()
67
+ if file == "" {
68
+ return fmt.Errorf("file argument is empty")
69
+ }
70
}
71
if _, err := os.Stat(file); !os.IsNotExist(err) {
72
return nil
0 commit comments