mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #2782 from shibukawa/fix/make_clean
fix make clean abort when build dir contains files like .DS_Store.
This commit is contained in:
commit
9916518fee
2
CHANGES
2
CHANGES
@ -5,7 +5,7 @@ Bugs fixed
|
|||||||
----------
|
----------
|
||||||
|
|
||||||
* applehelp: Sphinx crashes if ``hiutil`` or ``codesign`` commands not found
|
* applehelp: Sphinx crashes if ``hiutil`` or ``codesign`` commands not found
|
||||||
|
* Fix ``make clean`` abort issue when build dir contains regular files like ``DS_Store``.
|
||||||
|
|
||||||
Release 1.4.5 (released Jul 13, 2016)
|
Release 1.4.5 (released Jul 13, 2016)
|
||||||
=====================================
|
=====================================
|
||||||
|
@ -18,13 +18,12 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
|
||||||
from os import path
|
from os import path
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
from sphinx.util.console import bold, blue
|
from sphinx.util.console import bold, blue
|
||||||
from sphinx.util.osutil import cd
|
from sphinx.util.osutil import cd, rmtree
|
||||||
|
|
||||||
proj_name = os.getenv('SPHINXPROJ', '<project>')
|
proj_name = os.getenv('SPHINXPROJ', '<project>')
|
||||||
|
|
||||||
@ -75,7 +74,7 @@ class Make(object):
|
|||||||
return 1
|
return 1
|
||||||
print("Removing everything under %r..." % self.builddir)
|
print("Removing everything under %r..." % self.builddir)
|
||||||
for item in os.listdir(self.builddir):
|
for item in os.listdir(self.builddir):
|
||||||
shutil.rmtree(self.builddir_join(item))
|
rmtree(self.builddir_join(item))
|
||||||
|
|
||||||
def build_help(self):
|
def build_help(self):
|
||||||
print(bold("Sphinx v%s" % sphinx.__display_version__))
|
print(bold("Sphinx v%s" % sphinx.__display_version__))
|
||||||
|
@ -213,3 +213,10 @@ def cd(target_dir):
|
|||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
|
||||||
|
def rmtree(path):
|
||||||
|
if os.path.isdir(path):
|
||||||
|
shutil.rmtree(path)
|
||||||
|
else:
|
||||||
|
os.remove(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user