diff --git a/repoman.sh b/repoman.sh index f576838..9d0bd5c 100755 --- a/repoman.sh +++ b/repoman.sh @@ -4,16 +4,16 @@ INVOKE_DIR=${PWD}/ _export() { while read -r d do - pushd "$d/.." >/dev/null - PRJ_DIR=${PWD#"$INVOKE_DIR"} - REMOTE=$(git remote get-url origin 2>/dev/null) - popd >/dev/null + pushd "$d/.." >/dev/null + PRJ_DIR=${PWD#"$INVOKE_DIR"} + REMOTE=$(git remote get-url origin 2>/dev/null) + popd >/dev/null - if [ -z "$REMOTE" ]; then - continue - fi + if [ -z "$REMOTE" ]; then + continue + fi - echo "$PRJ_DIR=$REMOTE" + echo "$PRJ_DIR=$REMOTE" done < <(find . -type d -name '.git' -follow) } @@ -22,16 +22,16 @@ _import() { do IFS='=' read PRJ_DIR REMOTE <<< "$line" - echo; echo "⏳ Cloning $PRJ_DIR" - git clone $REMOTE $PRJ_DIR + echo; echo "⏳ Cloning $PRJ_DIR" + git clone $REMOTE $PRJ_DIR done < "${1:-/dev/stdin}" } if [ -t 0 ]; then # tty - _export + _export else # no tty - _import + _import fi