iridakos/stup

md file not saved as date

maartenhendrix opened this issue ยท 9 comments

I'm trying to get this to work on my mac but i don't think the date part works as creating an entry will not create a date file as shown below.

Maarten:stup/ $ stup add @ today -n "test 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
Maarten:stup/ $ ls
categories.conf work
Maarten:stup/ $ ls work
--.md

How can I fix this?

You're not the only one having problems with dateโ€”look at #6 (comment), the solution might work also for you.

Still same result after installing coreutils with brew:

Maarten:~/ $ brew install coreutils
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
awscli โœ”         bochs            erlang@21        exploitdb        gjs              logtalk          platformio       rust             vgmstream

==> Downloading https://homebrew.bintray.com/bottles/coreutils-8.32.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/67/67a4452d75a1882bd7fb977b384204edfa2758276d66290e595487922368e093?__gda__=exp=1588079851~hmac=747ba33e
######################################################################## 100.0%
==> Pouring coreutils-8.32.catalina.bottle.tar.gz
==> Caveats
Commands also provided by macOS have been installed with the prefix "g".
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
  PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
==> Summary
๐Ÿบ  /usr/local/Cellar/coreutils/8.32: 476 files, 9.2MB
==> `brew cleanup` has not been run in 30 days, running now...
Pruned 1 symbolic links and 2 directories from /usr/local
Maarten:~/ $ stup add @ today -n "test 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
Maarten:~/ $ cd stup
Maarten:stup/ $ ls
categories.conf work
Maarten:stup/ $ ls work
--.md
Maarten:stup/ $ gdate
Tue Apr 28 15:06:02 CEST 2020
Maarten:stup/ $ ls
categories.conf work
Maarten:~/ $ rm -rf stup 
Maarten:~/ $ stup --configure 
Please specify which directory stup will be using to store your notes.
By default, the notes will be stored in /Users/Maarten/stup.
>>> Press enter to use the default location or fill in your desired destination:
Keeping default directory.
Please specify which category will be your default one (if you have many).
The default category is currently set to "work".
>>> Press enter to keep the default or fill in a new one (ex. review):
Default category still set to "work".
Please specify which editor you want to use when manually editing your notes.
The default editor is currently set to "vim".
>>> Press enter to keep the default or fill in a new one (ex. vim):
Keeping the default editor: vim.
The config file contains some more goodies, would you like to edit it now?
>>> Type yes|y to edit the file or anything else to abort:
Maarten:~/ $ stup add @ today -n "test 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
Maarten:~/ $ ls stup/work
--.md

Have you tried it with stup at the commit mentioned in that comment?

Sorry i'm on master.
So that might have been the problem why it did not work. sorry about that.
Thanks for the nice tool by the way love it.

Hi @maartenhendrix and thanks for reporting.

Did you solve the problem? Unfortunately, I can't test the script on OSX.

Yes it fixes the problem

@all-contributors please add @tiosgz for question.

@iridakos

I've put up a pull request to add @tiosgz! ๐ŸŽ‰

Hi @maartenhendrix , thanks to @haganbmj you most probably can use version 0.1.5 which takes cares of the missing date function in OSX.

I will close the issue for now but in case you have the same problem again feel free to reopen it.

Thansk for reporting!