mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
Clean documentation directory when 'setup.py clean' is run
This commit is contained in:
parent
7f307dc5a2
commit
7906b0ab5e
13
setup.py
13
setup.py
@ -21,6 +21,7 @@ Plinth setup file
|
||||
"""
|
||||
|
||||
from distutils import log
|
||||
from distutils.command.clean import clean
|
||||
from distutils.command.install_data import install_data
|
||||
from distutils.util import change_root
|
||||
import glob
|
||||
@ -44,6 +45,15 @@ DIRECTORIES_TO_COPY = [
|
||||
]
|
||||
|
||||
|
||||
class CustomClean(clean):
|
||||
"""Override clean command to clean documentation directory"""
|
||||
def run(self):
|
||||
"""Execute clean command"""
|
||||
subprocess.check_call(['make', '-C', 'doc', 'clean'])
|
||||
|
||||
clean.run(self)
|
||||
|
||||
|
||||
class CustomInstallData(install_data):
|
||||
"""Override install command to allow directory creation and copy"""
|
||||
def run(self):
|
||||
@ -125,5 +135,6 @@ setuptools.setup(
|
||||
('/etc/plinth/modules-enabled',
|
||||
glob.glob(os.path.join('data/etc/plinth/modules-enabled',
|
||||
'*')))],
|
||||
cmdclass={'install_data': CustomInstallData},
|
||||
cmdclass={'clean': CustomClean,
|
||||
'install_data': CustomInstallData},
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user