Closed beruic closed 8 years ago
Thank you for the report. After analyzing the stack trace I believe this happens when your latest tag is not a valid semver string. Is this the case in your repository?
Running from a gulpfile is perfectly fine. Although I originally wrote this with backend (micro)services in mind, I recently used it in the gulpfile of an Ionic/Cordova project too, in order to have the git describe information available from inside the app -- pretty useful to identify the exact version someone is running.
Yes. This is the case in our repository. The version is currently v2.5-138-g2565af
. Why does semver make it fail?
Semver requires a third number, v2.5.0
is valid but v2.5
is not. As for why this causes node-git-describe to fail, this is simply an oversight on my part combined with a lack of test cases. My repositories always have semver tags, so I didn't run into this issue myself, but it should also work when the tag is not a valid semver of course.
I pushed a quick fix for this issue to git and npm. I'm also planning on doing some work on code quality improvements and test cases in the near future.
It works. Thanks a bunch :)
I get the following every time I try to run
var gitInfo = gitDescribeSync(__dirname);
. I don't know if it has any significance, but I run it in mygulppfile.js
.The error is:
Update: Contextual information: