jordemort / secrets.sh

Simple secrets manager in bash using GPG
MIT License
8 stars 3 forks source link

Mac date fix #7

Closed deleonjavier closed 2 years ago

deleonjavier commented 6 years ago

Hey @jordemort,

the secrets.sh list command wasn't working for me on my mac. So I added this, so I thought I'd share. 👍

jordemort commented 6 years ago

Is gdate installed on Mac OS by default? I often forget that I put coreutils on my PATH - I wonder if there's some alternative that will definitely work on a stock system on either OS.

jordemort commented 6 years ago

Hey can you reproduce the error that you were having? I tried with /bin/date on my Mac and it seems to support both of the formats I'm using:

jordan@dorothy:~/GitHub/for-business (build-release-planning-2018-07 % u=)$ /bin/date '+%F %I:%M%p %Z'
2018-07-26 10:04AM CDT
jordan@dorothy:~/GitHub/for-business (build-release-planning-2018-07 % u=)$ /bin/date '+%s'
1532617469
deleonjavier commented 6 years ago

When I use secrets.sh out of the box

[deleonjavier: (master)@deleonjavier secrets.sh]: secrets list
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
javier                                                                                                                                                                                                                                                 |

Where my date command is


DATE(1)                   BSD General Commands Manual                  DATE(1)

NAME
     date -- display or set date and time

SYNOPSIS
     date [-jRu] [-r seconds | filename] [-v [+|-]val[ymwdHMS]] ... [+output_fmt]
     date [-jnu] [[[mm]dd]HH]MM[[cc]yy][.ss]
     date [-jnRu] -f input_fmt new_date [+output_fmt]
     date [-d dst] [-t minutes_west]

I also found this in my .bashrc commented out.

#PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

where this exists:

date -> ../../bin/gdate
deleonjavier commented 2 years ago

😄 Just cleaning up my opened PRs. Great tool BTW, I still use it. 33