try transforming remote to https url magically, dunno if this is smart

This commit is contained in:
Mark Riedesel 2024-11-20 17:58:11 -06:00
parent b87403801f
commit 759d6f217e

View file

@ -33,9 +33,21 @@ function smart_clone() {
die "$DOTFILES_ROOT already exists, aborting." die "$DOTFILES_ROOT already exists, aborting."
fi fi
else else
ssh -o StrictHostKeyChecking=accept-new "${DOTFILES_REMOTE%%:*}" # If we have ssh keys that our host accepts
if ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new "${DOTFILES_REMOTE%%:*}" exit; then
git clone --bare $DOTFILES_REMOTE $DOTFILES_ROOT --branch $DOTFILES_BRANCH git clone --bare $DOTFILES_REMOTE $DOTFILES_ROOT --branch $DOTFILES_BRANCH
else
git clone --bare $(remote_ssh_to_https $DOTFILES_REMOTE) $DOTFILES_ROOT --branch $DOTFILES_BRANCH
fi fi
fi
}
function remote_ssh_to_https {
remote="$1"
remote="${remote/://}"
remote="${remote/git@/https://}"
remote="${remote%.git}"
echo "$remote"
} }
function check_requirements() { function check_requirements() {