nerdgeschoss / shimmer

Shimmer is a collection of Rails extensions that bring advanced UI features into your app and make your life easier as a developer.
https://nerdgeschoss.de
MIT License
5 stars 1 forks source link

add guards to db commands #86

Closed jmarsh24 closed 1 month ago

jmarsh24 commented 10 months ago

Both @Adeynack and I ran into an issue when trying to run rails db:pull without having the heroku remote added that we ran into the following error which isn't very descriptive to the issue that the app isn't linked properly. I have added a guard statement for both pull_data and pull_assets db tasks that provide instructions to install aws-cli and link the repo to heroku if it's missing.

❯ rails db:pull
Dropped database 'copacoupona_development'
Dropped database 'copacoupona_test'
heroku pg:pull DATABASE_URL copacoupona_development
 ›   Error: Missing required flag:
 ›    -a, --app APP  app to run command against
 ›   See more help with --help
bin/rails aborted!
Command failed with status (2): [heroku pg:pull DATABASE_URL copacoupona_deve...]

Tasks: TOP => db:pull => db:pull_data
(See full trace by running task with --trace)