build_flutter_version icon indicating copy to clipboard operation
build_flutter_version copied to clipboard

Error when not under git

Open letsar opened this issue 7 years ago • 4 comments

If we try to run build_runner with this package on a folder which is not a git repository we have the following error:

[SEVERE] build_flutter_version on lib/$lib$:

ProcessException: stdout:

stderr:
fatal: Not a git repository (or any of the parent directories): .git

It would be nice if the build process didn't end with an error and just ignore the git data part (Maybe with a warning instead).

letsar avatar Oct 10 '18 19:10 letsar

Yep it try to get the last git version.

On first phase I plan to make this a requirement then late generate partial field on the Version class if not present.

What's your feeling on this ?

Solido avatar Oct 10 '18 20:10 Solido

Initialise myself a .git dir would be too much intrusive ? or should be available as an option ?

Solido avatar Oct 10 '18 20:10 Solido

I think it would be better if it was just an option. Setting gitInfo to null in this case.

letsar avatar Oct 10 '18 20:10 letsar

I'll go further by not generating the gitInfo field.

Solido avatar Oct 10 '18 20:10 Solido