diff --git a/README.md b/README.md index 64a95ae..94636e1 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,14 @@ Advanced Features Setting a CHEATPATH ---------------------- + +By default cheatsheets are stored in the `~/.cheat/` directory, you can +override it by setting `DEFAULT_CHEAT_DIR` environment variable. + +```bash +export DEFAULT_CHEAT_DIR=/path/to/my/cheats +``` + By default, all cheatsheets are installed to `~/.cheat/`, but you can instruct `cheat` to look for cheatsheets in other directories by exporting a `CHEATPATH` environment variable: diff --git a/cheat b/cheat index 2abc94a..22007a8 100755 --- a/cheat +++ b/cheat @@ -3,7 +3,8 @@ import os import sys import subprocess -DEFAULT_CHEAT_DIR = os.path.join(os.path.expanduser('~'), '.cheat') +DEFAULT_CHEAT_DIR = os.environ.get('DEFAULT_CHEAT_DIR') or \ + os.path.join(os.path.expanduser('~'), '.cheat') USE_PYGMENTS = False # NOTE remove this check if it is confirmed to work on windows