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

New post-generation/bootstrap logic does not consistently check for command success #17

Open
jgonggrijp opened this issue May 20, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@jgonggrijp
Copy link
Contributor

The bootstrap command convention as I originally wrote it, is to define a named command at module scope:

https://github.com/UUDigitalHumanitieslab/cookiecutter-webapp-deluxe/blob/c32ac65129466650c32b3ec4310c8b70d3093a99/hooks/post_gen_project.py#L118-L121

This enables us to attempt running the command by name, keep track of whether the run was successful, and print out the same command to the user if it wasn't:

https://github.com/UUDigitalHumanitieslab/cookiecutter-webapp-deluxe/blob/c32ac65129466650c32b3ec4310c8b70d3093a99/hooks/post_gen_project.py#L44

https://github.com/UUDigitalHumanitieslab/cookiecutter-webapp-deluxe/blob/c32ac65129466650c32b3ec4310c8b70d3093a99/hooks/post_gen_project.py#L77

The new Angular-centered bootstrap logic does not use this convention, instead using anonymous, immediately-invoked command expressions:

https://github.com/UUDigitalHumanitieslab/cookiecutter-webapp-deluxe/blob/c32ac65129466650c32b3ec4310c8b70d3093a99/%7B%7Bcookiecutter.slug%7D%7D/bootstrap.py#L225-L228

which makes it impossible to display the command to the user if it needs to be reattempted.

Adding to this, error handling in these new parts of the logic is rather inconsistent. In many cases, such as the quote above, errors are simply ignored. This means (a) that the cookiecutter user must pay close attention to the hook output in order to notice the failed command at all and (b) that subsequent steps will be run even if their preconditions are not met.

Fix: restore the convention so that command are only run if their preconditions are met and so that the user gets to see all commands that still have to be run afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant