-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·34 lines (31 loc) · 879 Bytes
/
install.sh
File metadata and controls
executable file
·34 lines (31 loc) · 879 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
#!/bin/bash
! [ -d ~/.dotfile_backup ] && mkdir ~/.dotfile_backup
for i in .*; do
if ! [ "$i" == "." ] && ! [ "$i" == ".." ] && ! [ "$i" == ".git" ]; then
if [ -e ~/$i ]; then
if ! ( cp ~/$i ~/.dotfile_backup/$i ) || ! ( rm ~/$i || unlink ~/$i ); then
echo "Failed on $i" > /dev/stderr
exit 1
fi
fi
if ln -s $(pwd)/$i ~/$i; then
echo "Linked: $i" > /dev/stderr
else
echo "Failed on $i" > /dev/stderr
exit 1
fi
fi
done
# Ghostty: symlink config to ~/.config/ghostty/config
mkdir -p ~/.config/ghostty
if [ -e ~/.config/ghostty/config ]; then
cp ~/.config/ghostty/config ~/.dotfile_backup/ghostty-config
rm ~/.config/ghostty/config
fi
if ln -s $(pwd)/.ghostty-config ~/.config/ghostty/config; then
echo "Linked: .ghostty-config -> ~/.config/ghostty/config" > /dev/stderr
else
echo "Failed on ghostty config" > /dev/stderr
exit 1
fi
exit 0