Skip to content

Commit

Permalink
uri from file
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Dec 12, 2023
1 parent 494c8d8 commit 9ac09a6
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ func (m *Migration) RunAndExit() {

m.CLI().Action = func(ctx *cli.Context) error {
var err error
mongoURI := strings.ReplaceAll(m.config.uri, " ", "")
m.client, err = mongo.Connect(m.ctx, options.Client().ApplyURI(mongoURI))
m.client, err = mongo.Connect(m.ctx, options.Client().ApplyURI(strings.TrimSpace(m.config.uri)))
if err != nil {
return fmt.Errorf("unable to connect to MongoDB: %w", err)
}
Expand Down Expand Up @@ -152,7 +151,6 @@ func (m *Migration) Initialize() error {
Name: "uri",
Usage: "mongo connection URI",
Destination: &m.config.uri,
Value: "",
Required: false,
FilePath: "./uri",
},
Expand Down

0 comments on commit 9ac09a6

Please sign in to comment.