summaryrefslogtreecommitdiff
path: root/install.sh
blob: 22f0cf4b1f1e5b178b5dba85c0f171829b968c73 (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
#!/bin/sh

if [ $# -lt 1 ]; then
    echo "usage: $0 user | global"
    exit 1
fi

case "$1" in
    user)
        mod="mods/VimperatorrcBuilder"
        git submodule update -i --remote "$mod" &&
        (
            python "$mod/example.py" > "user/.vimperatorrc"
        )
        rm -rf tmp
        echo "installing the user configuration..."
        find user -maxdepth 1 -mindepth 1 -exec cp -ivr {} ~ \;
        ;;
    global)
        echo "installing the global configuration..."
        find global -maxdepth 1 -mindepth 1 -exec cp -ivr {} / \;
        ;;
    *)
        echo "invalid command"
        ;;
esac