mirror of
https://github.com/danielepintore/os-configurer.git
synced 2026-06-15 20:25:13 +02:00
download dotfiles without needing ssh key, then change origin to require
ssh key
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# helper to run git for dotfiles
|
||||
cfggit() {
|
||||
/usr/bin/git --git-dir="$HOME/.cfg" --work-tree="$HOME" "$@"
|
||||
}
|
||||
|
||||
# set up my dotfiles
|
||||
echo -e "\e[31m❌ Manual intervation needed: please be sure to add your ssh keys on github.\e[0m" >&2
|
||||
echo -e "\e[31mPress any key to continue\e[0m" >&2
|
||||
read -r
|
||||
cd $HOME
|
||||
if ! (git clone --bare git@github.com:danielepintore/dotfiles.git $HOME/.cfg &&
|
||||
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME checkout -f &&
|
||||
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME config --local status.showUntrackedFiles no); then
|
||||
if ! (git clone --bare https://github.com/danielepintore/dotfiles.git $HOME/.cfg &&
|
||||
cfggit checkout -f &&
|
||||
cfggit config --local status.showUntrackedFiles no &&
|
||||
cfggit remote set-url origin git@github.com:danielepintore/dotfiles.git); then
|
||||
echo -e "\e[31m❌ Manual intervation needed: failed to setup your dotfiles.\e[0m" >&2
|
||||
echo -e "\e[31mPress any key to continue\e[0m" >&2
|
||||
read -r
|
||||
Reference in New Issue
Block a user