Skip to content

Commit

Permalink
Print correct message when pclint not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Pablo Samper committed Apr 8, 2018
1 parent f246035 commit 2b7483e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ament_pclint/ament_pclint/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,14 @@ def main(argv=sys.argv[1:]):
return 1

additional_paths = None
pclint_bin = find_executable('pclp64', additional_paths=additional_paths)
exec_name = 'pclp64'
if sys.platform == 'linux':
exec_name += '_linux'
elif sys.platform == 'darwin':
exec_name += '_osx'
pclint_bin = find_executable(exec_name, additional_paths=additional_paths)
if not pclint_bin:
print("Could not find pclint executable 'pclp64'", file=sys.stderr)
print("Could not find pclint executable '{}'".format(exec_name), file=sys.stderr)
return 1

# Prepare pclint command
Expand Down Expand Up @@ -223,10 +228,6 @@ def execute_analysis(cmd, result, retvals, idx):


def find_executable(file_name, additional_paths=None):
if sys.platform == 'linux':
file_name += '_linux'
elif sys.platform == 'darwin':
file_name += '_osx'
path = None
if additional_paths:
path = os.getenv('PATH', os.defpath)
Expand Down

0 comments on commit 2b7483e

Please sign in to comment.