Skip to content

Commit 920e7a6

Browse files
aclark4lifeCopilot
andcommitted
Check MONGODB_URI in django-drop-mongo justfile recipe
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0e4f836 commit 920e7a6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • src/dbx_python_cli/templates/project_template

src/dbx_python_cli/templates/project_template/justfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ alias mm := django-makemigrations
2424

2525
[group('django')]
2626
django-drop-mongo:
27-
mongosh --eval "db.getSiblingDB('{{ project_name }}').dropDatabase()"
27+
#!/usr/bin/env sh
28+
if [ -n "$MONGODB_URI" ]; then
29+
mongosh "$MONGODB_URI" --eval "db.dropDatabase()"
30+
else
31+
mongosh --eval "db.getSiblingDB('{{ project_name }}').dropDatabase()"
32+
fi
2833
2934
[group('django')]
3035
django-drop-postgres:

0 commit comments

Comments
 (0)