forked from rmm5t/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·29 lines (21 loc) · 781 Bytes
/
install.sh
File metadata and controls
executable file
·29 lines (21 loc) · 781 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
#!/bin/bash
# Inspired by http://errtheblog.com/posts/89-huba-huba
# This is idempotent, meaning you can run it over and over again without fear of
# breaking anything. Use it as an installer or to upgrade after merging from an
# upstream fork.
home="$HOME"
# Get the absolute path of the directory containing this script
dotfiles_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$dotfiles_dir" || exit 1
for file in *; do
# Skip install script and README
if [[ "$file" == "install.sh" || "$file" == "README.md" || "$file" == "install.rb" ]]; then
continue
fi
target="$home/.$file"
echo "Linking $dotfiles_dir/$file to $target"
ln -nsf "$dotfiles_dir/$file" "$target"
done
# Sync submodules
git submodule sync
git submodule update --init --recursive