-
Notifications
You must be signed in to change notification settings - Fork 1
/
dotfiles.sh
executable file
·55 lines (47 loc) · 2.14 KB
/
dotfiles.sh
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
50
51
52
53
54
55
#!/usr/bin/env bash
#####
# dotfiles.sh -- install dotfiles symlinks
#
# author: Pat Gaffney <[email protected]>
#
# This file creates symlinks for the dotfiles in the *current
# directory* to $HOME.
#
#####################################################################
# Include dotfiles when looping.
shopt -s dotglob
# Create the $HOME/.completions directory if it does not exist.
mkdir -p "$HOME/.completions"
# Symlink all the dotfiles.
# ln -s :: create symbolic link
# ln -v :: verbose mode- print details
echo $'\e[1;34mInstalling symlinks:\e[0m'
# Create a symlink for each appropriate dotfile to $HOME.
for file in *; do
if [[ -d $file ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is a directory\n" "$file"
elif [[ -x $file && $file == *"completion.bash" ]]; then
ln -sv "$PWD/$file" "$HOME/.completions";
elif [[ -x $file ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is an executable\n" "$file"
elif [[ $file == *.png ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is a picture\n" "$file"
elif [[ $file == .gitignore ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is a gitignore\n" "$file"
elif [[ $file == *.md ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is a Markdown file\n" "$file"
elif [[ $file == *.terminal ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is a Terminal settings file\n" "$file"
elif [[ $file == *.itermcolors ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is an iTerm2 color file\n" "$file"
elif [[ $file == *.json ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is a JSON file\n" "$file"
elif [[ $file == *.sublime-settings ]]; then
printf "dotfiles.sh: Skipping \'%s\' -- it is a Sublime file\n" "$file"
else ln -sv "$PWD/$file" "$HOME";
fi
done
# Create symlink for my iTerm2 profiles to AppSupport directory.
ln -sv "$PWD/iterm-profiles.json" "$HOME/Library/Application Support/iTerm2/DynamicProfiles"
# Create the symlink for the Sublime Text preferences.
ln -sv "$PWD/Preferences.sublime-settings" "$HOME/Library/Application Support/Sublime Text/Packages/User"