Merge branch 'release-11.8.1' into nightly

This commit is contained in:
Labrys of Knossos 2018-12-29 12:21:41 -05:00
commit 85b4e22046

View file

@ -106,7 +106,10 @@ def clean_folders(*paths):
def clean(*paths):
"""Clean up bytecode and obsolete folders."""
def _clean(*paths):
with WorkingDirectory(module_path()) as cwd:
if cwd.working_directory != cwd.original_directory:
print('Changing to directory:', cwd.working_directory)
print('\n-- Cleaning bytecode --')
try:
result = clean_bytecode()
@ -114,7 +117,8 @@ def clean(*paths):
print(error)
else:
print(result or 'No bytecode to clean')
if paths:
if paths and os.path.exists('.git'):
print('\n-- Cleaning folders: {} --'.format(paths))
try:
result = clean_folders(*paths)
@ -122,13 +126,6 @@ def clean(*paths):
print(error)
else:
print(result or 'No folders to clean\n')
with WorkingDirectory(module_path()) as cwd:
if cwd.working_directory != cwd.original_directory:
print('Changing to directory:', cwd.working_directory)
if os.path.exists('.git'):
_clean(*paths)
else:
print('Directory is not a git repository')