dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit c590feb7d9a9567d9dc4ea568fb87c5817238cd6
parent 073a121b5c6efc14b16ee7f513676379dad4cf4e
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Thu,  8 Feb 2018 17:47:38 -0500

Gracefully handle absent .netrc

Diffstat:
M.local/bin/my-netrc | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.local/bin/my-netrc b/.local/bin/my-netrc @@ -8,7 +8,10 @@ import netrc import sys def parse_netrc(host, token=None): - authenticators = netrc.netrc().authenticators(host) + try: + authenticators = netrc.netrc().authenticators(host) + except FileNotFoundError: + exit('my-netrc: You don\'t have a netrc file!') if authenticators is None: exit('my-netrc: ' + host + ' not found') elif token == 'login':