1 $mypath = $MyInvocation.MyCommand
.Path
2 $machpath = $mypath.substring
(0, $mypath.length
- 4)
4 if (Get-Command py
-ErrorAction SilentlyContinue
) {
5 $python_executable = "py"
7 $python_executable = "python"
10 if (-not
(test-path env
:MACH_PS1_USE_MOZILLABUILD
)) {
11 &$python_executable $machpath $args
15 if (-not
(test-path env
:MOZILLABUILD
)) {
16 echo "No MOZILLABUILD environment variable found, terminating."
20 $machpath = ($machpath -replace
'\\', '/')
22 if ($machpath.contains
(' ')) {
24 The repository path contains whitespace which currently isn't supported
in mach
.ps1
.
25 Please run MozillaBuild manually for now
.
30 for ($i = 0; $i -lt $args.length; $i++) {
32 if ($arg.contains(' ')) {
34 The command contains whitespace which currently isn
't supported in mach.ps1.
35 Please run MozillaBuild manually for now.
41 $mozillabuild_version = Get-Content "$env:MOZILLABUILD\VERSION"
42 # Remove "preX" postfix if the current MozillaBuild is a prerelease.
43 $mozillabuild_version = [decimal
]($mozillabuild_version -replace
"pre.*")
45 if ($mozillabuild_version -ge
4.0) {
46 & "$env:MOZILLABUILD/start-shell.bat" -no-start
-defterm
-c
"$machpath $args"
48 & "$env:MOZILLABUILD/start-shell.bat" $machpath $args