Released version 3-2014010502
[notion.git] / contrib / install-scripts.sh
blob2d8d8b54687b85f9c91aec8055529740eda47bda
1 #!/bin/bash
3 # by Dan Weiner <dbw@uchicago.edu>
4 # Public Domain
6 # This script will install the scripts in SCRIPT_DIRS, via symlinks,
7 # to INSTALL_LOCATION.
9 # Make sure INSTALL_LOCATION doesn't contain anything important.
10 # It may get overwritten!
12 INSTALL_LOCATION="$HOME/.notion/lib"
13 SCRIPT_DIRS="keybindings scripts statusbar statusd styles"
15 ########################################################################
17 for DIR in $SCRIPT_DIRS ; do
18 [ -d $DIR ] && continue
19 echo "$0: error: missing $DIR/." > /dev/stderr ; exit 1
20 done
22 mkdir -p "$INSTALL_LOCATION" || exit 1
23 find $SCRIPT_DIRS -type f |\
24 while read FILE ; do
25 echo "$FILE"
26 ln -s -f "$PWD/$FILE" "$INSTALL_LOCATION" && continue
27 echo "$0: error: ln returned $?." > /dev/stderr ; exit 1
28 done
30 exit 0