pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
514 stars 117 forks source link

Add a get_data_file method to check system DATA_DIR #58

Closed apetresc closed 6 years ago

apetresc commented 8 years ago

This adds a much-needed quality-of-life improvement for users and packagers, namely the ability to specify a data directory when compiling (by default the standard /usr/local/share/pachi) and let Pachi load data files from that path in addition to the current working directory. This removes the need to always run pachi from the location of the data files, which is especially useful when using GUIs like Sabaki which don't let you set the working directory.

It is applied in the code to the datafiles now specified in Makefile, namely:

Please let me know if there's any I'm missing.

Note that this change is fully backwards compatible, as the current directory is still checked in addition to the global one.

Tested on both Linux and OS X. It will probably need some modification for Windows.

lemonsqueeze commented 6 years ago

Merged into PR #74, thanks !