File: install-scripts.sh

package info (click to toggle)
notion 3%2B2012042300-1
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy
  • size: 4,724 kB
  • sloc: ansic: 45,614; makefile: 544; sh: 409; perl: 113
file content (30 lines) | stat: -rw-r--r-- 832 bytes parent folder | download
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
#!/bin/bash

# by Dan Weiner <dbw@uchicago.edu>
# Public Domain

# This script will install the scripts in SCRIPT_DIRS, via symlinks,
# to INSTALL_LOCATION.

# Make sure INSTALL_LOCATION doesn't contain anything important.
# It may get overwritten!

INSTALL_LOCATION="$HOME/.notion/lib"
SCRIPT_DIRS="keybindings scripts statusd styles"

########################################################################

for DIR in $SCRIPT_DIRS ; do
        [ -d $DIR ] && continue
        echo "$0: error: missing $DIR/." > /dev/stderr ; exit 1
done

mkdir -p "$INSTALL_LOCATION" || exit 1
find $SCRIPT_DIRS -type f |\
        while read FILE ; do
                echo "$FILE"
                ln -s -f "$PWD/$FILE" "$INSTALL_LOCATION" && continue
                echo "$0: error: ln returned $?." > /dev/stderr ; exit 1
        done

exit 0