Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for optional callback in cli db commands vs straight process.exit #50

Closed
intabulas opened this issue Jan 8, 2016 · 3 comments · Fixed by #69
Closed

Allow for optional callback in cli db commands vs straight process.exit #50

intabulas opened this issue Jan 8, 2016 · 3 comments · Fixed by #69

Comments

@intabulas
Copy link
Contributor

While working on #43 / #36 the postdeploy in the heroku app.json allows for a single script. Depending on the state of the app when the web flow is initiated, there might also be migrations existing (say for someone deploying a sample app).

In this case having a super command, lets call it db:bootstrap, that would call both db:prepare and db:migrate inside maybe a async.series would be very helpful. Right now db commands have process.exit(0) in them.

This issue proposes we add an optional callback param to the db functions that would if excited would be called instead of process.exit(0) so that the next call in the series would fire. This also means we will need to arg and flags to all methods for consistency.

Needs more thought, but its the shell of the idea

@keithwhor
Copy link
Owner

I like the idea, if you can mock up what it might look like we can figure out how to rewrite the CLI (it's long overdue anyway).

@intabulas
Copy link
Contributor Author

@keithwhor implemented in a branch in my fork (no pr created yet). Right now it just adds the callback support to prepare and migrate and adds a bootstrap command to run both of them.

You can see it here https://github.com/intabulas/nodal/commit/13a2225c2c10fed8863c500a5a4f311186a9680f

@intabulas
Copy link
Contributor Author

I want to cleanup some of the undefined === callback copy pasta before I make it a pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants