mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
abort sphinx-quickstart when project path is not a empty directory.
This commit is contained in:
parent
ecfeece952
commit
5eb459f5a6
@ -1483,6 +1483,15 @@ def main(argv=sys.argv):
|
||||
d['makefile'] = False
|
||||
if 'no_batchfile' in d:
|
||||
d['batchfile'] = False
|
||||
|
||||
if path.exists(d['path']) and (
|
||||
not path.isdir(d['path']) or os.listdir(d['path'])):
|
||||
print()
|
||||
print(bold('Error: specified path is not a directory, or not a'
|
||||
' empty directory.'))
|
||||
print('sphinx-quickstart only generate into a empty directory.'
|
||||
' Please specify a new root path.')
|
||||
return
|
||||
else:
|
||||
ask_user(d)
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
|
Loading…
Reference in New Issue
Block a user