diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 15:11:07 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 15:11:07 +1200 |
commit | a0703ceedc8eb1d42a5afa1836c554ae9d5638a6 (patch) | |
tree | 73793061264e9bd3d654f6d9eba6a5c5b9a45b5f /bin | |
parent | Add isgr(1) (diff) | |
download | dotfiles-a0703ceedc8eb1d42a5afa1836c554ae9d5638a6.tar.gz dotfiles-a0703ceedc8eb1d42a5afa1836c554ae9d5638a6.zip |
Have td(1) use isgr(1)
Needs to test for its existence first, otherwise it'll create a
repository for no reason
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/td | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -27,15 +27,9 @@ fi # Change into the directory cd -- "$dir" || exit -# Quick function to determine if a directory is a Git repository -isrepo() { - { git symbolic-ref --quiet HEAD || - git rev-parse --short HEAD - } >/dev/null 2>&1 -} - # If the current directory isn't a Git repository, try to create one -if ! isrepo ; then +hash isgr || exit +if ! isgr ; then git init || exit fi |