File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ set -o xtrace # trace execution
6
6
# Create ~/.ssh if not exists
7
7
mkdir -p ~ /.ssh
8
8
9
- # # Add github's host key to known_hosts (if not yet)
10
- # if ! grep github.com ~/.ssh/known_hosts >/dev/null 2>&1; then
11
- # ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
12
- # fi
9
+ # Add github's host key to known_hosts (if not yet)
10
+ if ! grep github.com ~ /.ssh/known_hosts > /dev/null 2>&1 ; then
11
+ command -v ssh-keyscan > /dev/null &&
12
+ ssh-keyscan -t rsa github.com >> ~ /.ssh/known_hosts
13
+ fi
13
14
14
15
# Clone repository (if not yet)
15
16
if [ ! -d ~ /.dotfiles ]; then
16
17
# First try cloning via ssh (only works if owner of repo)
18
+ GIT_TERMINAL_PROMPT=0 \
17
19
git clone
[email protected] :lainiwa/dotfiles.git
~ /.dotfiles
||
18
20
# Clone via https otherwise
19
21
git clone https://github.com/lainiwa/dotfiles.git ~ /.dotfiles
You can’t perform that action at this time.
0 commit comments