#!/bin/sh # Clones from resolving the arguments and switches into the new directory remote=$(git-repo "$@") echo "Cloning $remote" git clone $remote ${@:4} --recurse-submodules || return $? cd "$(test $4 && echo $4 || basename ${remote%.git})"