Skip to content

Commit

Permalink
fix: Intercept error during DB drop (blockscout#11618)
Browse files Browse the repository at this point in the history
  • Loading branch information
akolotov authored Jan 15, 2025
1 parent 9a96db1 commit f1e0031
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .devcontainer/bin/bs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,15 @@ initialize_project() {
# Define the initialization subroutine
initialize_db() {
echo "Initializing database. Step 1 of 2: Dropping database"
mix ecto.drop > /dev/null 2>&1
echo "Initializing database. Step 2 of 2: Creating database"
mix do ecto.create, ecto.migrate | grep Runn
if OUTPUT=$(mix ecto.drop 2>&1); then
echo "Initializing database. Step 2 of 2: Creating database"
mix do ecto.create, ecto.migrate | grep Runn
else
echo "Failed to drop database. Initialization aborted."
echo "Error output:"
echo "$OUTPUT"
return 1
fi
}

# Define the compile subroutine
Expand Down

0 comments on commit f1e0031

Please sign in to comment.