gecko-dev/servo/mach
Ravi Shankar 33112472a8 servo: Merge #13151 - Make sure that mach gets the correct paths of executables in virtualenv (from Wafflespeanut:mach_cleanup); r=Ms2ger
<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13141 (github issue number if applicable).

<!-- Either: -->
- [x] These changes do not require tests because it's a cleanup related to `mach`

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: e699d9bfad6ce5e1b0cf31d5a6d06512e267f41a
2016-09-01 06:58:50 -05:00

26 lines
833 B
Bash
Executable File

#!/bin/sh
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# The beginning of this script is both valid shell and valid python,
# such that the script starts with the shell and is reexecuted with
# the right python.
'''which' python2.7 > /dev/null 2> /dev/null && exec python2.7 "$0" "$@" || exec python "$0" "$@"
'''
from __future__ import print_function, unicode_literals
import os
import sys
def main(args):
topdir = os.path.abspath(os.path.dirname(sys.argv[0]))
sys.path.insert(0, os.path.join(topdir, "python"))
import mach_bootstrap
mach = mach_bootstrap.bootstrap(topdir)
sys.exit(mach.run(sys.argv[1:]))
if __name__ == '__main__':
main(sys.argv)