mirror of https://github.com/cheat/cheat.git
Cheatsheets are now package data for new cheatlib package
This commit is contained in:
parent
de2471b93a
commit
027354474f
6
cheat
6
cheat
|
@ -1,10 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import pkg_resources
|
||||
import sys
|
||||
|
||||
# assembles a list of directories containing cheatsheets
|
||||
def cheat_directories():
|
||||
paths = [os.path.expanduser('~/.cheat')]
|
||||
try:
|
||||
paths.append(pkg_resources.resource_filename('cheatlib', 'cheatsheets'))
|
||||
except ImportError:
|
||||
pass # cheatlib was not installed
|
||||
paths.extend(os.environ.get('CHEATPATH', '').split(os.pathsep))
|
||||
return [path for path in paths if os.path.isdir(path)]
|
||||
|
||||
|
|
7
setup.py
7
setup.py
|
@ -9,8 +9,7 @@ setup(name='cheat',
|
|||
author='Chris Lane',
|
||||
author_email='chris@chris-allen-lane.com',
|
||||
url='https://github.com/chrisallenlane/cheat',
|
||||
packages=['cheatsheets'],
|
||||
package_data={'cheatsheets': [f for f in os.listdir('cheatsheets')
|
||||
if '.' not in f]},
|
||||
scripts=['cheat']
|
||||
packages=['cheatlib'],
|
||||
package_data={'cheatlib': ['cheatsheets/*']},
|
||||
scripts=['cheat'],
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue