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

Better error if git not installed #958

Merged

Conversation

itowlson
Copy link
Contributor

Fixes #953.

The output when git is not installed is still not 100% crisp, and we could do with bypassing the context stack for these "known" cases. But this at least gives the specific message pointing the finger at git:

# --- Template case ---
$ spin templates install --git https://github.com/fermyon/spin
Copying remote template source
Error: Failed to install one or more templates

Caused by:
    0: Failed to get template source
    1: Error cloning Git repo https://github.com/fermyon/spin: `git` command not found - is git installed?

# --- Plugin case ---
$ spin plugin install js2wasm
Error: failed to connect to endpoint https://github.com/fermyon/spin-plugins/: Error cloning Git repo https://github.com/fermyon/spin-plugins/: `git` command not found - is git installed?

I'm not sure there is a sensible way to deduplicate this with the current cratification of the Spin CLI, bar lots of micro-crates or the spin-util crate of shame, but I'm open to ideas!

Signed-off-by: itowlson ivan.towlson@fermyon.com

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@kate-goldenring
Copy link
Contributor

For deduplication, should we create a single git crate that both templates and plugins use, containing the pulling and error capabilities?

@itowlson
Copy link
Contributor Author

@kate-goldenring We could create a git crate. I worry, though, that whole crates for each relatively small piece of duplication is going to get fiddly to manage. Although having an entry called sloth in the folder list would certainly cheer me up in the mornings.

@kate-goldenring
Copy link
Contributor

@itowlson it seems like this could be a larger discussion we could have around what the criteria for utility crates are in spin. We could leave duplication for now and create an issue around the discussion?

@itowlson
Copy link
Contributor Author

@kate-goldenring I opened #965 but yeah, it would be nice not to have to wait on that discussion!

@itowlson itowlson merged commit 15fd8b6 into fermyon:main Dec 12, 2022
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 this pull request may close these issues.

spin should give user friendly error if git is not installed
2 participants