Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 36 lines (33 sloc) 0.952 kb
add8d79 @jferris Install script
jferris authored
1 #!/bin/sh
2
3 cutstring="DO NOT EDIT BELOW THIS LINE"
4
5 for name in *; do
6 target="$HOME/.$name"
7 if [ -e $target ]; then
8 if [ ! -L $target ]; then
9 cutline=`grep -n -m1 "$cutstring" "$target" | sed "s/:.*//"`
10 if [[ -n $cutline ]]; then
11 let "cutline = $cutline - 1"
12 echo "Updating $target"
13 head -n $cutline "$target" > update_tmp
14 startline=`tail -r "$name" | grep -n -m1 "$cutstring" | sed "s/:.*//"`
15 if [[ -n $startline ]]; then
16 tail -n $startline "$name" >> update_tmp
17 else
18 cat "$name" >> update_tmp
19 fi
20 mv update_tmp "$target"
21 else
22 echo "WARNING: $target exists but is not a symlink."
23 fi
24 fi
25 else
26 if [[ $name != 'install.sh' ]]; then
27 echo "Creating $target"
28 if [[ -n `grep "$cutstring" "$name"` ]]; then
29 cp "$PWD/$name" "$target"
30 else
31 ln -s "$PWD/$name" "$target"
32 fi
33 fi
34 fi
35 done
Something went wrong with that request. Please try again.