summarylogtreecommitdiffstats
path: root/doomrl.sh
blob: a4f07e934847f634f97a01f2bcd8a0878d5b4660 (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/bash
dir="${XDG_DATA_HOME:-$HOME/.local/share}/doomrl"
bin=/usr/share/doomrl

if [[ ! -d "$dir" ]]; then
    mkdir -p "$dir" || exit 1

    cp $bin/log.txt "$dir" || :
    cp $bin/error.log "$dir" || :
    cp $bin/{core,doomrl,player,score}.wad "$dir" || :
    cp $bin/{colors,config,keybindings,musichq,soundhq}.lua "$dir" || exit 1
    cp $bin/doom.prc "$dir" || :
    cp -r $bin/backup "$dir" || exit 1
    cp -r $bin/modules "$dir" || exit 1
    cp -r $bin/mortem "$dir" || exit 1
    cp -r $bin/screenshot "$dir" || exit 1

    ln -s $bin/doomrl "$dir" || exit 1
    ln -s $bin/doomrl_{gnome-terminal,konsole,xterm} "$dir" || exit 1
    ln -s $bin/{manual,unix_notes,version_api,version}.txt "$dir" || exit 1
    ln -s $bin/mp3 "$dir" || exit 1
    ln -s $bin/wavhq "$dir" || exit 1 
fi

cd "$dir"
exec $bin/doomrl $1