Skip to content

Commit 853bc96

Browse files
authored
fix: link password flag override (#3295)
1 parent 64facde commit 853bc96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/link.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ var (
3333
if err := flags.LoadConfig(fsys); err != nil {
3434
return err
3535
}
36+
// TODO: move this to root cmd
37+
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", cmd.Flags().Lookup("password")))
3638
return link.Run(ctx, flags.ProjectRef, fsys)
3739
},
3840
}
@@ -43,6 +45,5 @@ func init() {
4345
linkFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.")
4446
linkFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
4547
// For some reason, BindPFlag only works for StringVarP instead of StringP
46-
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", linkFlags.Lookup("password")))
4748
rootCmd.AddCommand(linkCmd)
4849
}

0 commit comments

Comments
 (0)