-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinvade.sh
More file actions
executable file
·40 lines (30 loc) · 757 Bytes
/
Copy pathinvade.sh
File metadata and controls
executable file
·40 lines (30 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env sh
set -ex
PREFIX="$HOME"
DOTFILES="$PREFIX/dotfiles"
BACKUPS="$PREFIX/backups"
function sym () {
src="$DOTFILES/$1"
dest="$PREFIX/$2"
if [ -e "$dest" ]; then
newdest="$BACKUPS/$(basename $dest)-$(date +%s)"
mv "$dest" "$newdest"
echo "> Moved $dest to $newdest"
fi
ln -s "$src" "$dest"
}
if [ ! -e "$DOTFILES" ]; then
echo "error: dotfiles/ needs to reside in $PREFIX"
exit 1
fi
mkdir -p "$PREFIX"
mkdir -p "$BACKUPS/vim_backups"
sym bashrc .bashrc
sym gitconfig .gitconfig
sym tmux.conf .tmux.conf
sym zshrc .zshrc
sym nvim.lua .config/nvim/init.lua
sym rgignore .rgignore
sym aerospace.toml .aerospace.toml
touch $DOTFILES/bash/local
echo "> Invasion successful!"