#!/bin/sh
export GAME_EXECUTABLE=/usr/bin/blastem
export GAME_LOCALDIR=$HOME/.config/blastem
export GAME_DATADIR=/usr/share/blastem

set -e

if test ! -d $GAME_LOCALDIR; then
	mkdir $GAME_LOCALDIR && cp -r $GAME_DATADIR/shaders $GAME_LOCALDIR && cp -r /usr/share/blastem/*.cfg $GAME_LOCALDIR && cp $HOME/.config/blastem/default.cfg $HOME/.config/blastem/blastem.cfg
fi
cd $GAME_LOCALDIR && exec $GAME_EXECUTABLE
