Skip to content

Commit

Permalink
Support multi-target truffle project args
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuhs committed Jan 13, 2020
1 parent 95acab8 commit 68cb115
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mythx_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,13 @@ def analyze(
jobs.append(generate_solidity_payload(target_elem, solc_version))
continue
elif Path(target_elem).is_dir():
jobs = walk_solidity_files(ctx, solc_version, base_path=target_elem)
files = find_truffle_artifacts(Path(target_elem))
if files:
# extract truffle artifacts if config found in target
jobs.extend([generate_truffle_payload(file) for file in files])
else:
# recursively enumerate sol files if not a truffle project
jobs.extend(walk_solidity_files(ctx, solc_version, base_path=target_elem))
else:
raise click.exceptions.UsageError(
"Could not interpret argument {} as bytecode or Solidity file".format(target_elem)
Expand Down

0 comments on commit 68cb115

Please sign in to comment.