try transforming remote to https url magically, dunno if this is smart
This commit is contained in:
parent
b87403801f
commit
759d6f217e
1 changed files with 14 additions and 2 deletions
16
bin/dotfiles
16
bin/dotfiles
|
@ -33,11 +33,23 @@ function smart_clone() {
|
|||
die "$DOTFILES_ROOT already exists, aborting."
|
||||
fi
|
||||
else
|
||||
ssh -o StrictHostKeyChecking=accept-new "${DOTFILES_REMOTE%%:*}"
|
||||
git clone --bare $DOTFILES_REMOTE $DOTFILES_ROOT --branch $DOTFILES_BRANCH
|
||||
# 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
|
||||
else
|
||||
git clone --bare $(remote_ssh_to_https $DOTFILES_REMOTE) $DOTFILES_ROOT --branch $DOTFILES_BRANCH
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function remote_ssh_to_https {
|
||||
remote="$1"
|
||||
remote="${remote/://}"
|
||||
remote="${remote/git@/https://}"
|
||||
remote="${remote%.git}"
|
||||
echo "$remote"
|
||||
}
|
||||
|
||||
function check_requirements() {
|
||||
for DEP in ${DEPENDENCIES[@]}; do
|
||||
has $DEP || die "${DEP} not found, please install and try again."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue