2022-04-15 14:11:00 +02:00
|
|
|
#!/bin/zsh
|
|
|
|
# Set up dotfiles on a new machine.
|
|
|
|
|
|
|
|
setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
|
|
|
|
|
|
|
|
local repo_address="https://schlomp.space/tastytea/dotfiles.git"
|
2024-03-11 22:59:49 +01:00
|
|
|
alias config='git --git-dir=${HOME}/.dotfiles --work-tree=${HOME}'
|
|
|
|
|
|
|
|
local response
|
|
|
|
while [[ ! ${response} =~ '[yYnN]' ]]; do
|
|
|
|
print -n "use SSH? [y/n] "
|
|
|
|
read response
|
|
|
|
done
|
|
|
|
if [[ ${response[1]} =~ "[yY]" ]]; then
|
2022-04-15 14:11:00 +02:00
|
|
|
repo_address="git@schlomp.space:tastytea/dotfiles.git"
|
|
|
|
fi
|
|
|
|
|
2022-05-09 01:00:29 +02:00
|
|
|
git clone --bare ${repo_address} ${HOME}/.dotfiles
|
|
|
|
config config --local status.showUntrackedFiles no
|
2022-08-19 23:49:33 +02:00
|
|
|
config config --local core.worktree ${HOME}
|
|
|
|
config config core.bare false
|
2022-05-09 01:00:29 +02:00
|
|
|
|
|
|
|
print -P "%F{12}Run%f" \
|
|
|
|
"%F{13}rm ${0} &&" \
|
2024-04-18 21:27:29 +02:00
|
|
|
"git --git-dir=${HOME}/.dotfiles --work-tree=${HOME} checkout" \
|
2022-05-09 01:00:29 +02:00
|
|
|
"%F{12}to copy the files to your home directory.%f"
|