markchalloner / git-semver

Git plugin for Semantic Versioning
MIT License
382 stars 43 forks source link

Problem with 'date -j' on Debian Jessie #10

Closed achaussier closed 8 years ago

achaussier commented 8 years ago

Hello,

First, thanks for the share.

With the resolution of #9 with d16599d44516d42c57a1a1f407fd93d3f2cf6ffd, I have an error due to -j option (not exists in Jessie) :

 ~  dev  git-semver   master  ✔  00:19:41  130  git semver get
date : option invalide -- 'j'
Saisissez « date --help » pour plus d'informations.
date : option invalide -- 'j'
Saisissez « date --help » pour plus d'informations.
/usr/local/bin/git-semver: ligne 185 : [: -86400 : opérateur unaire attendu
2.0.2

Perhaps it should be useful to add a ondition to choice the proper date syntax, based on date version or OS family/distribution ?

For information :

arghasen commented 8 years ago

Same issue is on Mac OSX El Capitan

x3ro commented 8 years ago

:+1:

aguegu commented 8 years ago

same problem on ubuntu.

The quick fix would be disabling the auto update.

@markchalloner I wonder what your develop environment is.

markchalloner commented 8 years ago

@arghasen, have you installed homebrew coreutils by any chance? What is your output from date --version?

markchalloner commented 8 years ago

Commit fd76272 should fix this issue. Test by:

$ git semver get
Warning: Forcing update check (UPDATE_CHECK_FORCE=1)
New version 2.0.2 found. Update (y/n)? (defaults to "y"): n
2.0.2
arghasen commented 8 years ago

Looks good Mark. A couple of new warnings are up though Arghas-MacBook-Pro% git semver get usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] /usr/local/bin/git-semver: line 188: 2016-05-03: command not found /usr/local/bin/git-semver: line 201: 2016-05-03: command not found /usr/local/bin/git-semver: line 205: [: -86400: unary operator expected 2.0.2

arghasen commented 8 years ago

I had home-brew coreutils earlier but now I am using the stock date from OSX

markchalloner commented 8 years ago

Thanks should be fixed on master