G7 증명과 G8 clean-head 승격 준비
This commit is contained in:
parent
94c681d450
commit
5221f79e3f
52 changed files with 6876 additions and 506 deletions
|
|
@ -1,3 +1,36 @@
|
|||
Option Explicit
|
||||
|
||||
If WScript.Arguments.Count > 0 Then
|
||||
If LCase(WScript.Arguments(0)) = "syntax-only" Then
|
||||
WScript.Quit 0
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim objShell
|
||||
Dim command
|
||||
Dim exitCode
|
||||
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
cmd = "powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File ""D:\workspace\vignette\scripts\watch-public-runtime.ps1"" -Workspace ""D:\workspace\vignette"""
|
||||
objShell.Run cmd, 0, True
|
||||
command = "$ErrorActionPreference='Stop';" & _
|
||||
"$task=Get-ScheduledTask -TaskName 'VignettePublicRuntimeWatchdog' -ErrorAction Stop;" & _
|
||||
"$action=@($task.Actions)[0];" & _
|
||||
"if([IO.Path]::GetFileName($action.Execute) -ne 'powershell.exe'){throw 'Pinned watchdog task must execute powershell.exe'};" & _
|
||||
"$root=$action.WorkingDirectory;if([string]::IsNullOrWhiteSpace($root)){throw 'Pinned watchdog working directory is missing'};" & _
|
||||
"$quote=[char]34;$expectedScript=Join-Path $root 'scripts\watch-public-runtime.ps1';" & _
|
||||
"$expectedFileArg='-File '+$quote+$expectedScript+$quote;$expectedRootArg='-StableSourceRoot '+$quote+$root+$quote;" & _
|
||||
"if($action.Arguments.IndexOf($expectedFileArg,[StringComparison]::OrdinalIgnoreCase) -lt 0){throw 'Pinned watchdog script path does not match its working directory'};" & _
|
||||
"if($action.Arguments.IndexOf($expectedRootArg,[StringComparison]::OrdinalIgnoreCase) -lt 0){throw 'Pinned watchdog source root does not match its working directory'};" & _
|
||||
"$required=@('-StableSourceRoot','-ExpectedSourceCommit','-ExpectedSourceTree','-ExpectedWatchdogSha256','-ExpectedStartScriptSha256');" & _
|
||||
"foreach($marker in $required){if($action.Arguments.IndexOf($marker,[StringComparison]::Ordinal) -lt 0){throw ('Unpinned watchdog task action: missing '+$marker)}};" & _
|
||||
"if($action.Arguments -match '(?i)(?:^|\s)-Workspace(?:\s|$)'){throw 'Legacy shared-worktree watchdog action is forbidden'};" & _
|
||||
"Start-ScheduledTask -TaskName 'VignettePublicRuntimeWatchdog'"
|
||||
command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -Command """ & _
|
||||
Replace(command, """", """""") & """"
|
||||
If WScript.Arguments.Count > 0 Then
|
||||
If LCase(WScript.Arguments(0)) = "print-command" Then
|
||||
WScript.Echo command
|
||||
WScript.Quit 0
|
||||
End If
|
||||
End If
|
||||
exitCode = objShell.Run(command, 0, True)
|
||||
WScript.Quit exitCode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue