move mkdir_if_not_exists to utils.py

Reviewed By: jeremydubreil

Differential Revision: D2642424

fb-gh-sync-id: 57707a7
master
Jules Villard 9 years ago committed by facebook-github-bot-1
parent 1848f6deba
commit 9efc1b6be7

@ -21,7 +21,7 @@ import shutil
import subprocess
import sys
from inferlib import analyze, config, source, utils
from inferlib import config, source, utils
HTML_REPORT_DIR = 'report.html'
TRACES_REPORT_DIR = 'traces'
@ -346,10 +346,10 @@ def html_list_of_bugs(args, remote_source_template, selector):
def generate_html_report(args, reports):
html_dir = os.path.join(args.infer_out, HTML_REPORT_DIR)
shutil.rmtree(html_dir, True)
analyze.mkdir_if_not_exists(html_dir)
utils.mkdir_if_not_exists(html_dir)
traces_dir = os.path.join(html_dir, TRACES_REPORT_DIR)
analyze.mkdir_if_not_exists(traces_dir)
utils.mkdir_if_not_exists(traces_dir)
sel = Selector(args, reports)

@ -190,17 +190,11 @@ def remove_infer_out(infer_out):
shutil.rmtree(infer_out, True)
def mkdir_if_not_exists(path):
try:
os.mkdir(path)
except OSError:
pass
def create_results_dir(results_dir):
mkdir_if_not_exists(results_dir)
mkdir_if_not_exists(os.path.join(results_dir, 'specs'))
mkdir_if_not_exists(os.path.join(results_dir, 'captured'))
mkdir_if_not_exists(os.path.join(results_dir, 'sources'))
utils.mkdir_if_not_exists(results_dir)
utils.mkdir_if_not_exists(os.path.join(results_dir, 'specs'))
utils.mkdir_if_not_exists(os.path.join(results_dir, 'captured'))
utils.mkdir_if_not_exists(os.path.join(results_dir, 'sources'))
def clean(infer_out):

@ -278,6 +278,13 @@ def interact():
code.interact(local=locals())
def mkdir_if_not_exists(path):
try:
os.mkdir(path)
except OSError:
pass
def search_files(root_dir, extension):
# Input:
# - root directory where to start a recursive search of yjson files

Loading…
Cancel
Save