inject mongodb uri inside the binary and os
This commit is contained in:
@@ -22,6 +22,10 @@ var SubmitCmd = &cobra.Command{
|
||||
return nil
|
||||
}
|
||||
|
||||
if !cmd.Flags().Changed("dev") {
|
||||
fmt.Println("DBUri", app.Config.DbUri)
|
||||
}
|
||||
|
||||
db, err := storage.NewMongoStorageInteractive(cmd.Context(), app.Config.DbUri)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to connect to database: %w", err)
|
||||
@@ -37,3 +41,7 @@ var SubmitCmd = &cobra.Command{
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
SubmitCmd.Flags().Bool("dev", false, "Show DB connection details for development purposes")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user