Skip to content

Commit

Permalink
Merge pull request #51 from andrewjpage/master
Browse files Browse the repository at this point in the history
strip off input params when testing if exec is in path
  • Loading branch information
andrewjpage committed Oct 3, 2012
2 parents 7da8a60 + 406480a commit 9c34b3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion run_gubbins.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ def delete_files_based_on_list_of_regexes(directory_to_search, regex_for_file_de
os.remove(full_path_of_file_for_deletion)

def which(program):
executable = program.split(" ")
program = executable[0]
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
Expand All @@ -279,7 +281,7 @@ def is_exe(fpath):
exe_file = os.path.join(path, program)
if is_exe(exe_file):
return exe_file

return None


Expand Down

0 comments on commit 9c34b3c

Please sign in to comment.