meta:git-remote: Add origin as fallback remote
In the rare case that no remote url containing `druckdev/dotfiles` exists, this should still (try to) work. This could be the case if I rename my username or the repo or in the even rarer case that somebody forks this... Quite ambitious.
This commit is contained in:
@@ -6,6 +6,7 @@ die() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remote="$(git remote -v | grep -m1 "druckdev/dotfiles" | cut -f1)"
|
remote="$(git remote -v | grep -m1 "druckdev/dotfiles" | cut -f1)"
|
||||||
|
: "${remote:=origin}"
|
||||||
url="$(git remote get-url "$remote")"
|
url="$(git remote get-url "$remote")"
|
||||||
! printf "$url" | grep -q '^git@' || die "Using ssh already.\n" 0
|
! printf "$url" | grep -q '^git@' || die "Using ssh already.\n" 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user