always create .start if it doesn't exist

Summary:public
`rm -rf infer-out && infer --reactive --continue -a capture -- clang -c hello.c` used to crash.

closes #315

Differential Revision: D3109673

fb-gh-sync-id: 661bd07
fbshipit-source-id: 661bd07
master
Jules Villard 9 years ago committed by Facebook Github Bot 4
parent af4a2c1301
commit 2a41d7b0ff

@ -126,8 +126,8 @@ def main():
if imported_module:
analyze.create_results_dir(args.infer_out)
if not args.continue_capture:
analyze.reset_start_file(args.infer_out)
analyze.reset_start_file(args.infer_out,
touch_if_present=not args.continue_capture)
utils.configure_logging(args)
logging.info('Running command %s', ' '.join(sys.argv))

@ -175,10 +175,11 @@ def create_results_dir(results_dir):
utils.mkdir_if_not_exists(os.path.join(results_dir, 'sources'))
def reset_start_file(results_dir):
# create new empty file - this will update modified timestamp
open(os.path.join(results_dir, '.start'), 'w').close()
def reset_start_file(results_dir, touch_if_present=False):
start_path = os.path.join(results_dir, '.start')
if (not os.path.exists(start_path)) or touch_if_present:
# create new empty file - this will update modified timestamp
open(start_path, 'w').close()
def clean(infer_out):
directories = [

Loading…
Cancel
Save