summaryrefslogtreecommitdiffstats
path: root/install
blob: 206cac47b616bddf04ed3ca1c0e3fc0a7a583047 (plain)
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/sh

DEST_DIR=$HOME/bin

rm *~ 2>/dev/null
for f in *; do
    # TODO check within a list with grep
    [ "$f" == "install" -o "$f" == "bashrc" ] && continue
    ff=$(readlink -f $f)
    if [ ! -e $DEST_DIR/$f ]; then
        echo "symlink $DEST_DIR/$f" && ln -s $ff $DEST_DIR/$f
    else
        bf=$(readlink -e $DEST_DIR/$f)
        if [ "$bf" != "$ff" ]; then
            echo "$bf is not OK"
        fi
    fi
done

for f in "bashrc"; do
    ff=$(readlink -f $f)
    if [ ! -e $HOME/.$f ]; then
        echo "symlink $HOME/$f" && ln -s $ff $HOME/.$f
    else
        bf=$(readlink -e $HOME/.$f)
        if [ "$bf" != "$ff" ]; then
            echo "$bf is not OK"
        fi
    fi
done