summary refs log tree commit diff
path: root/install.sh
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2015-05-24 04:01:23 -0400
committerJune McEnroe <programble@gmail.com>2015-05-24 04:01:23 -0400
commit5188f04ee9c96ece8becba35df85edeadc41a626 (patch)
tree6b35081272c1461ece58110b4fd15cc4d6a7c8b3 /install.sh
parentAdd tmux shortcut functions (diff)
downloadsrc-5188f04ee9c96ece8becba35df85edeadc41a626.tar.gz
src-5188f04ee9c96ece8becba35df85edeadc41a626.zip
Replace effuse with simple shell scripts
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100755
index 00000000..e0ed0c5f
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/bash
+
+# Create symlinks in ~ for files in the current directory.
+
+set -e
+
+error() {
+  echo "$1"
+  exit 1
+}
+
+paths=$(find $PWD -type f -not \( -path '*/.git/*' -o -path '*/Library/*' -o -name '.*.sw?' -o -name '.gitignore' -o -name 'README.md' -o -name '*.sh' -o -name '*.plist' \))
+
+for source_path in $paths; do
+  rel_path="${source_path#$PWD/}"
+  dest_path="$HOME/$rel_path"
+
+  [ -h "$dest_path" ] && continue
+  [ -e "$dest_path" ] && error "$dest_path exists"
+
+  mkdir -p "$(dirname $dest_path)"
+  ln -s "$source_path" "$dest_path"
+  echo "$rel_path"
+done