diff options
author | EuAndreh <eu@euandre.org> | 2022-10-27 22:54:34 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-10-27 22:54:34 -0300 |
commit | 8af3b16bb72b192b5a5bb2138447ec8893d1ff53 (patch) | |
tree | 626dee9fd9b0c402dde2813d5f7291be697b5b48 /bin/repos | |
parent | bin/vcs: Do not require TYPE, and guess it instead (diff) | |
download | dotfiles-8af3b16bb72b192b5a5bb2138447ec8893d1ff53.tar.gz dotfiles-8af3b16bb72b192b5a5bb2138447ec8893d1ff53.tar.xz |
bin/repos: Simplify, using the new vcs(1)
Diffstat (limited to 'bin/repos')
-rwxr-xr-x | bin/repos | 23 |
1 files changed, 5 insertions, 18 deletions
@@ -131,26 +131,13 @@ shift $((OPTIND - 1)) is_repository() { - if [ -e "$1"/.git ]; then - printf 'git:%s\n' "$1" - return 0 - elif [ -e "$1"/.hg ]; then - printf 'mercurial:%s\n' "$1" - return 0 - elif [ -e "$1"/.bk ]; then - printf 'bitkeeper:%s\n' "$1" - return 0 - elif [ -e "$1"/_darcs ]; then - printf 'darcs:%s\n' "$1" - return 0 - elif [ -e "$1"/CVS/ ]; then - printf 'cvs:%s\n' "$1" - return 0 - elif [ -e "$1"/.fslckout ]; then - printf 'fossil:%s\n' "$1" + TYPE="$(vcs -C "$1" -t)" + if [ -n "$TYPE" ]; then + printf '%s:%s\n' "$TYPE" "$1" return 0 + else + return 1 fi - return 1 } |