aivazis / config

10 stars 2 forks source link

Resolve relative path to mm script #6

Closed rtburns-jpl closed 5 years ago

rtburns-jpl commented 5 years ago

mm builder uses argv[0] verbatim, leading to errors when invoking via e.g. ../config/make/mm.py build

rtburns-jpl commented 5 years ago

I'm not sure of the best way to search env paths so the above fix only works when argv[0] is already a file path. Maybe just os.path.realpath(__file__) is simpler?

rtburns-jpl commented 5 years ago

Do you expect mm.py to ever be on your PATH? If so, this won't work - __file__ might be preferable

Edit: looks like new mm uses mm = f"{sys.executable} {__file__}"