l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
262 stars 31 forks source link

Requirements for macOS users #1

Closed onehr closed 4 years ago

onehr commented 4 years ago

Since strftime is a GNU gawk extension, macOS users should install gawk by homebrew or manually. I found strftime in those files:

awk/stats_positions.awk
         now = strftime("%FT%T", systime(), 1);
awk/filter_due.awk
         now = strftime("%FT%T", systime(), 1);
awk/utils.awk
         return strftime("%FT%T", systime() - 24 * 60 * 60 * n, 1);

Without installing gawk, the macOS will call the default awk and it cause problems. See Awk strftime on Mac OS X.

And for the command shuf, macOS users should install coreutils. See Install shuf on OS X?.

l3kn commented 4 years ago

Thanks for the info!

I'd like to implement a better algortihm for ordering due cards than just randomizing their order, that would get rid of the dependency on shuf.

In addition to that, I'll see how much slower emacs lisp variants of the stats scripts would be to remove the uses of strftime.

Unfortunately, I don't have access to a macOS system to test this on. Is the package working for you with these changes?

If so, I'll add your suggestions to the readme.

l3kn commented 4 years ago

I've removed the dependency on shuf and added a section on installing gawk to the readme. Let me know if that works for you!