]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc
BaseTools: Improve shell wrappers for Python build commands
[mirror_edk2.git] / BaseTools / Bin / CYGWIN_NT-5.1-i686 / Ecc
CommitLineData
a709adfa
LG
1#!/usr/bin/env bash
2#python `dirname $0`/RunToolFromSource.py `basename $0` $*
a709adfa 3
6928c1d3
CD
4# If a python2 command is available, use it in preference to python
5if command -v python2 >/dev/null 2>&1; then
6 python_exe=python2
7fi
8
9full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
10dir=$(dirname "$full_cmd")
11cmd=${full_cmd##*/}
12
13export PYTHONPATH="$dir/../../Source/Python"
14exec "${python_exe:-python}" "$dir/../../Source/Python/$cmd/$cmd.py" "$@"