Prevent .build creation for accidental builds

Esse commit está contido em:
Michael Sproul
2013-07-31 16:54:58 +10:00
commit 0cc022f2b0
+10 -3
Ver Arquivo
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
# -*- coding: utf-8; -*-
"""\
@@ -57,8 +57,15 @@ def main():
try:
e.process_args(args)
if current_command not in 'clean init' and not os.path.isdir(e.build_dir):
os.makedirs(e.build_dir)
# Create a .build directory if required
valid_project = os.path.isdir(e.src_dir)
do_anywhere = "init clean list-models serial"
if current_command not in do_anywhere:
if not valid_project:
raise Abort("No project found in this directory.")
elif not os.path.isdir(e.build_dir):
os.makedirs(e.build_dir)
args.func(args)
except Abort as exc: