version 1.1, 2011/11/13 21:41:23 |
version 1.2, 2021/08/11 09:03:52 |
|
|
|
|
# The executable needs to be run from its data directory, and needs to store |
# The executable needs to be run from its data directory, and needs to store |
# configuration in it. We therefore mirror the data directory hierarchy in |
# configuration in it. We therefore mirror the data directory hierarchy in |
# ~/.flare, and create symlinks to the data files. |
# ~/.fheroes2, and create symlinks to the data files. |
|
|
if [ -d ~/.flare ] |
if [ -d ~/.fheroes2 ] |
then |
then |
echo "Using existing ~/.flare directory." |
echo "Using existing ~/.fheroes2 directory." |
else |
else |
echo "Creating ~/.flare directory." |
echo "Creating ~/.fheroes2 directory." |
cd %%DATADIR%% || exit 1 |
cd %%DATADIR%% || exit 1 |
find . -type d \! \( -name config \) -exec mkdir -p ~/.flare/{} \; |
find . -type d \! \( -name config \) -exec mkdir -p ~/.fheroes2/{} \; |
find * -type f -exec ln -s %%DATADIR%%/{} ~/.flare/{} \; 2>/dev/null |
find * -type f -exec ln -s %%DATADIR%%/{} ~/.fheroes2/{} \; 2>/dev/null |
mkdir ~/.flare/config ~/.flare/saves |
mkdir ~/.fheroes2/config ~/.fheroes2/saves |
cp -f %%DATADIR%%/config/keybindings.txt ~/.flare/config/ |
cp -f %%DATADIR%%/config/keybindings.txt ~/.fheroes2/config/ |
cp -f %%DATADIR%%/config/settings.txt ~/.flare/config/ |
cp -f %%DATADIR%%/config/settings.txt ~/.fheroes2/config/ |
chmod 640 ~/.flare/config/keybindings.txt ~/.flare/config/settings.txt |
chmod 640 ~/.fheroes2/config/keybindings.txt ~/.fheroes2/config/settings.txt |
fi |
fi |
|
|
cd ~/.flare || exit 1 |
cd ~/.fheroes2 || exit 1 |
echo "Loading..." |
echo "Loading..." |
exec %%DATADIR%%/flare "$@" |
exec %%DATADIR%%/fheroes2 "$@" |