chore: initialize xas skills repository
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
[CmdletBinding(SupportsShouldProcess = $true)]
|
||||
param(
|
||||
[Parameter(DontShow = $true)][string]$ContinueUpdate
|
||||
)
|
||||
|
||||
Set-StrictMode -Version 2.0
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
try {
|
||||
Import-Module (Join-Path $PSScriptRoot 'scripts/XasUpdate.psm1') -Force
|
||||
if ($ContinueUpdate) {
|
||||
[Console]::OutputEncoding = New-Object Text.UTF8Encoding($false)
|
||||
if ($WhatIfPreference) { throw '内部更新续接不能与 -WhatIf 同时使用。' }
|
||||
Invoke-XasUpdateContinuation -RepositoryRoot $PSScriptRoot -Token $ContinueUpdate
|
||||
}
|
||||
else {
|
||||
Import-Module (Join-Path $PSScriptRoot 'scripts/XasSkills.psm1') -Force
|
||||
$skillsRoot = Get-XasDefaultSkillsRoot
|
||||
if ($WhatIfPreference) {
|
||||
Invoke-XasUpdate -RepositoryRoot $PSScriptRoot -SkillsRoot $skillsRoot -Preview
|
||||
}
|
||||
elseif ($PSCmdlet.ShouldProcess('origin/main 和本仓库已安装技能', '快进更新仓库并同步技能')) {
|
||||
Invoke-XasUpdate -RepositoryRoot $PSScriptRoot -SkillsRoot $skillsRoot
|
||||
}
|
||||
}
|
||||
exit 0
|
||||
}
|
||||
catch {
|
||||
Write-Error -Message $_.Exception.Message -ErrorAction Continue
|
||||
exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user