diff --git a/cheat/sheets.py b/cheat/sheets.py index 986003d..201c87d 100644 --- a/cheat/sheets.py +++ b/cheat/sheets.py @@ -64,7 +64,6 @@ class Sheets: """ Assembles a list of directories containing cheatsheets """ sheet_paths = [ self.default_path(), - '/usr/share/cheat', ] # merge the CHEATPATH paths into the sheet_paths diff --git a/config/cheat b/config/cheat index d45ba0c..fb1db33 100644 --- a/config/cheat +++ b/config/cheat @@ -1 +1,5 @@ -{"CHEAT_COLORS":true,"CHEAT_EDITOR":"vi"} +{ + "CHEAT_COLORS": true, + "CHEAT_EDITOR":"vi", + "CHEAT_PATH":"/usr/share/cheat" +} diff --git a/setup.py b/setup.py index c769680..d7da93b 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,17 @@ from distutils.core import setup import os +# determine the directory in which to install system-wide cheatsheets +# KLUDGE: It would be better to read `/usr/share/cheat` from `config/cheat` +# rather than hard-coding it here +cheat_path = os.environ.get('CHEAT_PATH') or '/usr/share/cheat' + +# aggregate the systme-wide cheatsheets cheat_files = [] for f in os.listdir('cheat/cheatsheets/'): cheat_files.append(os.path.join('cheat/cheatsheets/',f)) +# specify build params setup( name = 'cheat', version = '2.4.0', @@ -26,7 +33,7 @@ setup( 'pygments >= 1.6.0', ], data_files = [ - ('/usr/share/cheat', cheat_files), + (cheat_path, cheat_files), ('/etc', ['config/cheat']), ], )