leoafarias / fvm

Flutter Version Management: A simple CLI to manage Flutter SDK versions.
https://fvm.app
MIT License
4.44k stars 213 forks source link

[Enhancement] Show warning when git not installed #714

Open listepo opened 2 months ago

listepo commented 2 months ago

Before creating a bug report please make check the following

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to terminal..
  2. Install choco
  3. Install fvm
  4. See error

Creating local mirror...

✓ Clone complete ✗ Failed to ensure FlutterVersion(name: stable, releaseFromChannel: null, type: VersionType.channel) is cached.

Exception: Git clone failed

package:fvm/src/utils/parsers/git_clone_update_printer.dart 92 runGitCloneUpdate package:fvm/src/services/flutter_service.dart 146 FlutterService.updateLocalMirror package:fvm/src/workflows/ensure_cache.workflow.dart 85 ensureCacheWorkflow package:fvm/src/commands/install_command.dart 75 InstallCommand.run package:args/command_runner.dart 212 CommandRunner.runCommand package:fvm/src/runner.dart 246 FvmCommandRunner.runCommand package:fvm/src/runner.dart 122 FvmCommandRunner.run package:scope/src/scope.dart 151 Scope.run c:\programdata\chocolatey\lib\fvm\tools\source\bin\main.dart 13 main



**Desktop (please complete the following information):**

- OS: [Windows 11]
- FVM Version [e.g. 22]
- If Windows: Which Powershell are you using?
- Yes

**Additional context**
Add any other context about the problem here.
leoafarias commented 2 months ago

@listepo can you share the version of FVM, I believe this has been fixed in one of the latest versions.

listepo commented 2 months ago

I try install latest version

listepo commented 2 months ago

@leoafarias fvm --version 3.1.3

listepo commented 2 months ago

I found the problem, I didn't have git installed. I think you need to check and display a clear error. cc @leoafarias

Ay0ubCheurfi commented 2 months ago

@listepo, I'm also encountering this issue. I've verified that I have Git installed. Any insights would be appreciated.

Ay0ubCheurfi commented 2 months ago

@leoafarias, I'm getting this error despite using FVM v3.1.3, which I believe is the latest version. Any ideas what might be causing this?

leoafarias commented 2 months ago

@Ay0ubCheurfi Can you create a directory and run git clone https://github.com/flutter/flutter.git to see if there is an issue on git?

Ay0ubCheurfi commented 2 months ago

@listepo Just an update – the issue wasn't reflected correctly in the error message "Exception: Git clone failed". It was my internet connection. Switching networks fixed it.