34 lines
867 B
Bash
Executable file
34 lines
867 B
Bash
Executable file
#!/usr/bin/env sh
|
|
# Automatically deploys my rice onto a new system
|
|
|
|
git_url="https://github.com/agryphus/archrice.git"
|
|
location="$HOME/repos/dotfiles"
|
|
|
|
if [ ! -d "$location" ]; then
|
|
mkdir -p "$location"
|
|
fi
|
|
|
|
cd "$location"
|
|
|
|
if [ "$(git remote get-url origin 2> /dev/null)" != "$git_url" ]; then
|
|
git clone --bare "$git_url" .
|
|
fi
|
|
|
|
alias config="git --git-dir $location --work-tree=$HOME"
|
|
config config status.showUntrackedFiles no
|
|
|
|
# Checkout branch, but move collisions to ~/.config-backup
|
|
mkdir -p "$HOME/.config-backup"
|
|
config checkout 2>&1 \
|
|
| egrep "\s+\." | awk {'print $1'} \
|
|
| xargs -I {} mv {} "$HOME/.config-backup/"{}
|
|
|
|
# Fix unsafe permissions on gnupg directory
|
|
chmod 700 "$HOME/.local/share/gnupg/"
|
|
|
|
config submodule init
|
|
config submodule update --force --recursive --init --remote
|
|
config submodule foreach "git checkout master"
|
|
|
|
exec zsh
|
|
|