From 8af3b16bb72b192b5a5bb2138447ec8893d1ff53 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 27 Oct 2022 22:54:34 -0300 Subject: bin/repos: Simplify, using the new vcs(1) --- bin/repos | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/bin/repos b/bin/repos index 1e764ca..32fe1cd 100755 --- a/bin/repos +++ b/bin/repos @@ -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 } -- cgit v1.2.3