summarylogtreecommitdiffstats
path: root/dustforce-dustmod
blob: 4ad7fdb241960db604539d099c46f124cab0fb63 (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
#! /usr/bin/env sh

# Dustmod segfaults when it can't write to its install dir, so it's horrible
# hack time: create a temp dir, symlink all the game files to it, and run from
# there

temp_dir=

cleanup () {
    test -n "$temp_dir" && rm -rf "$temp_dir"
    exit "$1"
}
trap 'cleanup 1' INT TERM


temp_dir="$(mktemp -d)" || cleanup 1
cd "$temp_dir"
for f in /opt/dustforce-dustmod/*; do
    if [ "$(basename "$f")" = "dustmod.bin.x86_64" ]; then
        cp "$f" .
    else
        ln -s "$f" || cleanup 1
    fi
done

./dustmod.bin.x86_64
cleanup "$?"