Skip to content
Snippets Groups Projects
Commit 0492b82b authored by Mitchell Hentges's avatar Mitchell Hentges
Browse files

Bug 1750874: Support launching Mach with `py` instead of `python` r=glandium

When installing from Python.org, the `python` command isn't available by
default (in favour of `py`). Support using `py` instead.

There were issues running `hg` when `python` isn't added to the `PATH`,
so the docs are being updated accordingly.
Of course, it's still worth supporting `py`-instead-of-`python`
workflows for `git` users who won't be impacted by that bug.

Differential Revision: https://phabricator.services.mozilla.com/D136286
parent a37e7812
No related branches found
No related tags found
No related merge requests found
@ECHO OFF
SET topsrcdir=%~dp0
python %topsrcdir%mach %*
WHERE /q py
IF %ERRORLEVEL% EQU 0 (
py %topsrcdir%mach %*
) ELSE (
python %topsrcdir%mach %*
)
$mypath = $MyInvocation.MyCommand.Path
$machpath = ($mypath -replace '\\', '/').substring(0, $mypath.length - 4)
$machpath = $mypath.substring(0, $mypath.length - 4)
if (Get-Command py) {
$python_executable = "py"
} else {
$python_executable = "python"
}
if (-not (test-path env:MACH_PS1_USE_MOZILLABUILD)) {
python $machpath $args
&$python_executable $machpath $args
exit $lastexitcode
}
......@@ -11,6 +17,8 @@ if (-not (test-path env:MOZILLABUILD)) {
exit 1
}
$machpath = ($machpath -replace '\\', '/')
if ($machpath.contains(' ')) {
echo @'
The repository path contains whitespace which currently isn't supported in mach.ps1.
......
......@@ -55,7 +55,8 @@ Download Python from the `the official website <https://www.python.org/downloads
version is 3.10.1, so a safe version to install would be the most recent 3.9 release.
You'll want to download the "Windows installer (64-bit)" associated with the release you've chosen.
During installation, ensure that you check the "Add Python 3.x to PATH" option.
During installation, ensure that you check the "Add Python 3.x to PATH" option, otherwise you might
`encounter issues running Mercurial <https://bz.mercurial-scm.org/show_bug.cgi?id=6635>`__.
.. note::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment