Revert #830 because it broke the case when the main script is not in path.
This commit is contained in:
parent
207cdf2876
commit
08e43e8bfd
16
meson.py
16
meson.py
|
@ -17,4 +17,18 @@
|
|||
from mesonbuild import mesonmain
|
||||
import sys, os
|
||||
|
||||
sys.exit(mesonmain.run(sys.argv[0], sys.argv[1:]))
|
||||
def main():
|
||||
thisfile = __file__
|
||||
if not os.path.isabs(thisfile):
|
||||
thisfile = os.path.normpath(os.path.join(os.getcwd(), thisfile))
|
||||
if __package__ == '':
|
||||
thisfile = os.path.dirname(thisfile)
|
||||
|
||||
# The first argument *must* be an absolute path because
|
||||
# the user may have launched the program from a dir
|
||||
# that is not in path.
|
||||
sys.exit(mesonmain.run(thisfile, sys.argv[1:]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
|
Loading…
Reference in New Issue