-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add helpful message about installing git during blitz new
if it doesn't exist
#489
Comments
I totally agree that any non-critical failure (like git, pkg installation, etc) should not fail the entire process. Showing a helpful message about what we couldn't do is fantastic. For git specifically, it probably means git isn't installed, so we should add instructions/link on how to do that. |
Yeah, I do think it is not critical for the new app to be able to run. Some tools like |
We should absolutely be able to test for this and show install helpers. Like that a lot |
To verify the existence of installed clis it would require a bash script like: git --version 2>&1 >/dev/null # improvement by tripleee
GIT_IS_AVAILABLE=$?
# ...
if [ $GIT_IS_AVAILABLE -eq 0 ]; then #... ref: https://stackoverflow.com/questions/7292584/how-to-check-if-git-is-installed-from-bashrc |
blitz new
commandblitz new
if it doesn't exist
What is the problem?
@peaonunes pointed out here that we don't error out if any of the git steps fail, so I wanted to open it for discussion. Basically, if any step of the
git
initialization process fails we still exit with a success code and the resulting output could be not committed to git, or potentially even the repository initialization itself could have failed.While all of these are bad, I don't know that it's worth bailing out of the installation. With the changes in blitz-js/blitz#367 we'd end up skipping dependency initialization and the initial commit to the repo. Either of those not happening isn't great, but they're also not irrecoverable errors. In fact, it might create more confusion if we successfully generate files, but then show an error and exit with a non-zero exit code - it'll leave a user wondering "what broke?"
Instead I still think we should update the code, but instead track which steps failed and just show extra "getting started" steps in the event that any of those extra bits fails. Right now the final output just alerts the user to
cd
into the project and runblitz start
, but we could prepend items to that list with a brief explanation in the event that an earlier step fails. Say thegit init
command fails, we could print something like this:Thoughts?
The text was updated successfully, but these errors were encountered: