-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·49 lines (44 loc) · 1.31 KB
/
setup
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
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
source colors.sh
if [ "$(uname)" = "Darwin" ];
then
read -p "Do you want to install software for mac? (y/n): " yn
case $yn in
[Yy]* ) ./mac_software_install.sh;;
* ) echo "Skipping software installation"
esac
elif [ "$(uname)" = "Linux" ];
then
read -p "Do you want to install software for Linux? (y/n): " yn
case $yn in
[Yy]* ) ./linux_software_install.sh;;
* ) echo "Skipping software installation"
esac
fi
echo -e "${cyan}Symlinking setup files.${reset}"
for dotfile in .[A-Za-z]*;
do
if [[ "$dotfile" == *".swp"* ]]
then
continue
fi
echo $dotfile
if [ $dotfile = ".git" ] || [ $dotfile = ".DS_Store" ];
then
echo "Skipping $dotfile"
else
if [ -d $dotfile ]
then
echo "${yellow}${dotfile} is a folder${reset}"
mkdir ~/$(basename $dotfile)
ln -s $(pwd)/$dotfile/* ~/$(basename $dotfile)
else
echo "Creating symlink for dotfile: $dotfile"
ln -s $(pwd)/$dotfile ~/$(basename $dotfile)
fi
fi
done
echo "${green}Symlink creation successful!${reset}"
ln -s $(pwd)/startmux ~/startmux || echo "Error while symlinking tmux startup script"
rm ~/.zshrc
ln -s $(pwd)/.zshrc ~/.zshrc || echo "Error while symlinking .zshrc"