Annotation of ports/games/fheroes2/files/fheroes2, Revision 1.2
1.1 yason 1: #!/bin/sh
2:
3: # The executable needs to be run from its data directory, and needs to store
4: # configuration in it. We therefore mirror the data directory hierarchy in
1.2 ! kirby 5: # ~/.fheroes2, and create symlinks to the data files.
1.1 yason 6:
1.2 ! kirby 7: if [ -d ~/.fheroes2 ]
1.1 yason 8: then
1.2 ! kirby 9: echo "Using existing ~/.fheroes2 directory."
1.1 yason 10: else
1.2 ! kirby 11: echo "Creating ~/.fheroes2 directory."
1.1 yason 12: cd %%DATADIR%% || exit 1
1.2 ! kirby 13: find . -type d \! \( -name config \) -exec mkdir -p ~/.fheroes2/{} \;
! 14: find * -type f -exec ln -s %%DATADIR%%/{} ~/.fheroes2/{} \; 2>/dev/null
! 15: mkdir ~/.fheroes2/config ~/.fheroes2/saves
! 16: cp -f %%DATADIR%%/config/keybindings.txt ~/.fheroes2/config/
! 17: cp -f %%DATADIR%%/config/settings.txt ~/.fheroes2/config/
! 18: chmod 640 ~/.fheroes2/config/keybindings.txt ~/.fheroes2/config/settings.txt
1.1 yason 19: fi
20:
1.2 ! kirby 21: cd ~/.fheroes2 || exit 1
1.1 yason 22: echo "Loading..."
1.2 ! kirby 23: exec %%DATADIR%%/fheroes2 "$@"
CVSweb