If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. Note that this happens a
(command)
| 14 | |
| 15 | |
| 16 | def _FindCommandInPath(command): |
| 17 | """If there are no slashes in the command given, this function |
| 18 | searches the PATH env to find the given command, and converts it |
| 19 | to an absolute path. We have to do this because MSVS is looking |
| 20 | for an actual file to launch a debugger on, not just a command |
| 21 | line. Note that this happens at GYP time, so anything needing to |
| 22 | be built needs to have a full path.""" |
| 23 | if "/" in command or "\\" in command: |
| 24 | # If the command already has path elements (either relative or |
| 25 | # absolute), then assume it is constructed properly. |
| 26 | return command |
| 27 | else: |
| 28 | # Search through the path list and find an existing file that |
| 29 | # we can access. |
| 30 | paths = os.environ.get("PATH", "").split(os.pathsep) |
| 31 | for path in paths: |
| 32 | item = os.path.join(path, command) |
| 33 | if os.path.isfile(item) and os.access(item, os.X_OK): |
| 34 | return item |
| 35 | return command |
| 36 | |
| 37 | |
| 38 | def _QuoteWin32CommandLineArgs(args): |
no test coverage detected
searching dependent graphs…