mach.ps1
author Masayuki Nakano <masayuki@d-toybox.com>
Thu, 02 Feb 2023 05:09:15 +0000
changeset 651452 20512741e7b60f3f6791002d8311d681f9242e68
parent 612620 e7998d54cc54b819e64334374680fdece79285ef
permissions -rw-r--r--
Bug 1812170 - Make `HTMLEditor::ClearStyleAt` should return `pointToPutCaret` if next node of first split is not split r=m_kato The new path added in bug 1807829 hits the odd result case of `ClearStyleAt`. `pointToPutCaret` may be updated if the preceding split occurs. Therefore, it should be returned if it does not split next nodes after the first split instead of returning unset point (because of not splitting the point, `unwrappedSplitNodeResult.AtSplitPoint` may return unset point, therefore, it may return unset point in the case). Additionally, I forgot to split delete `SplitNodeResult::mCaretPoint` in bug 1792654, and it causes `SplitNodeDeepWithTransaction` returns unset caret point. This patch fixes this bug too. Differential Revision: https://phabricator.services.mozilla.com/D168179

$mypath = $MyInvocation.MyCommand.Path
$machpath = $mypath.substring(0, $mypath.length - 4)

if (Get-Command py -ErrorAction SilentlyContinue) {
  $python_executable = "py"
} else {
  $python_executable = "python"
}

if (-not (test-path env:MACH_PS1_USE_MOZILLABUILD)) {
  &$python_executable $machpath $args
  exit $lastexitcode
}

if (-not (test-path env:MOZILLABUILD)) {
  echo "No MOZILLABUILD environment variable found, terminating."
  exit 1
}

$machpath = ($machpath -replace '\\', '/')

if ($machpath.contains(' ')) {
  echo @'
The repository path contains whitespace which currently isn't supported in mach.ps1.
Please run MozillaBuild manually for now.
'@
  exit 1
}

for ($i = 0; $i -lt $args.length; $i++) {
  $arg = $args[$i]
  if ($arg.contains(' ')) {
    echo @'
The command contains whitespace which currently isn't supported in mach.ps1.
Please run MozillaBuild manually for now.
'@
    exit 1
  }
}

$mozillabuild_version = Get-Content "$env:MOZILLABUILD\VERSION"
# Remove "preX" postfix if the current MozillaBuild is a prerelease.
$mozillabuild_version = [decimal]($mozillabuild_version -replace "pre.*")

if ($mozillabuild_version -ge 4.0) {
  & "$env:MOZILLABUILD/start-shell.bat" -no-start -defterm -c "$machpath $args"
} else {
  & "$env:MOZILLABUILD/start-shell.bat" $machpath $args
}
exit $lastexitcode