Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip off input params when testing if exec is in path #51

Merged
merged 1 commit into from
Oct 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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