Skip to content

Commit

Permalink
Update resolve-database-path.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsayo committed Feb 11, 2025
1 parent e0d341c commit 642fab8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/cli/src/utils/resolve-database-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ export async function resolveDatabasePath(options?: { requiredConfig?: boolean }
message: "Enter path to create a database:",
});

// check if path was provided
if (!dbInput.value) {
logger.error("No path provided. Please provide a path to create a database.");
process.exit(1);
}

// check if the path is valid
if (!fs.existsSync(dbInput.value)) {
logger.error("Invalid path. Please provide a valid path or directory.");
process.exit(1);
Expand Down

0 comments on commit 642fab8

Please sign in to comment.