Skip to content

Commit

Permalink
Merge pull request #10 from frasersgroup/dont-parse-urls
Browse files Browse the repository at this point in the history
feat(mongo): Don't fail if can't parse url
  • Loading branch information
Maria Paktiti authored Oct 19, 2020
2 parents 276f9b6 + 10ba38c commit 6190c54
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/commands/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ function register(program) {
process.exit(0);
}

let parsedUrl = new URL(MONGO_URL);
parsedUrl.username = "USER";
parsedUrl.password = "PASS";
log(`MongoDB URL: ${parsedUrl.href}\n`);
try {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
const parsedUrl = new URL(MONGO_URL);
parsedUrl.username = "USER";
parsedUrl.password = "PASS";
} catch (error) {
log(error.stack || error, "error");
}


if (!options.yes) {
const { shouldContinue } = await inquirer.prompt([
Expand Down

0 comments on commit 6190c54

Please sign in to comment.