You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This script does a checkout of a Pull Request using the GitHub CLI, and then runs it using SandboxTest.ps1.
2
-
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost','', Justification ='This script is not intended to have any outputs piped')]
3
2
4
3
Param(
5
4
[Parameter(Position=0,HelpMessage='The Pull Request to checkout.',Mandatory=$true)]
if (-Not (Get-Command'gh'-ErrorAction 'SilentlyContinue')) {
28
-
Write-Host"The GitHub CLI is not installed. Install it via 'winget install GitHub.cli' and come back here!"-ForegroundColor Red
29
-
return
30
-
}
31
-
32
-
if (-Not (Get-Command'git'-ErrorAction 'SilentlyContinue')) {
33
-
Write-Host"Git is not installed. Install it via 'winget install Git.Git' and come back here!"-ForegroundColor Red
34
-
return
35
-
}
43
+
Write-Verbose'Ensuring Dependencies are Present'
44
+
if (!$script:GhIsPresent) { Write-Error"The GitHub CLI is not installed. Install it via 'winget install GitHub.cli' and come back here!"-ErrorAction Stop }
45
+
if (!$script:GitIsPresent) { Write-Error"Git is not installed. Install it via 'winget install Git.Git' and come back here!"-ErrorAction Stop }
46
+
if (!$script:SandboxIsPresent) { Write-Error'Windows Sandbox is not enabled. Enable it and come back here!'-ErrorAction Stop }
if ($LASTEXITCODE-ne0) { Write-Error"There was an error checking out the PR. Make sure you're logged into GitHub via 'gh auth login' and come back here!"-ErrorAction Stop }
38
51
39
-
if ($LASTEXITCODE-ne0) {
40
-
Write-Host"There was an error checking out the PR. Make sure you're logged into GitHub via 'gh auth login' and come back here!"-ForegroundColor Red
0 commit comments