iridakos / stup

Daily notes in the terminal :penguin:
https://github.com/iridakos/stup
MIT License
415 stars 31 forks source link

misc: detect and use gdate when available #30

Closed haganbmj closed 4 years ago

haganbmj commented 4 years ago

The GNU date function is different than the one on unix, so OSX users get all sorts of errors trying to do fancy date calculations with words like today.

~/git $ stup add -n "test"
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Successfully added 1 notes in category work for 

This likely still requires OSX users to install coreutils, I'm not clear if that's a default installation or not. It's readily available on brew though if needed https://formulae.brew.sh/formula/coreutils

iridakos commented 4 years ago

@haganbmj Excellent! :rocket: :rocket: :rocket:

@all-contributors please add @haganbmj for code.

allcontributors[bot] commented 4 years ago

@iridakos

I've put up a pull request to add @haganbmj! :tada: