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
14
bin/dotfiles
14
bin/dotfiles
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue