Fix bug in hook: ensure bin directory exists before listing.

This commit is contained in:
Todd Gamblin 2016-03-05 04:42:52 -08:00
parent fc6aa7374a
commit bfce2c7508

View File

@ -67,6 +67,9 @@ def post_install(pkg):
"""This hook edits scripts so that they call /bin/bash
$spack_prefix/bin/sbang instead of something longer than the
shebang limit."""
if not os.path.isdir(pkg.prefix.bin):
return
for file in os.listdir(pkg.prefix.bin):
path = os.path.join(pkg.prefix.bin, file)
if shebang_too_long(path):