fix version 1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[CmdletBinding()]
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[switch]$SkipVet
|
||||
)
|
||||
@@ -7,12 +7,21 @@ $ErrorActionPreference = "Stop"
|
||||
$workspaceRoot = Split-Path -Parent $PSScriptRoot
|
||||
Push-Location $workspaceRoot
|
||||
try {
|
||||
$unformatted = @(gofmt -l pkgs module)
|
||||
# 本地开发前提:go.work 把共享 SDK 替换为工作区外的相对路径,缺少该目录时整个工作区都无法解析。
|
||||
$sdkDir = [System.IO.Path]::GetFullPath((Join-Path $workspaceRoot "..\..\bsm-sdk\core"))
|
||||
if (-not (Test-Path -Path $sdkDir -PathType Container)) {
|
||||
throw "未找到共享 SDK 目录: $sdkDir`n本地开发前提不满足:请先将 bsm-sdk/core 检出到工作区上一级目录的同级路径,即 $sdkDir"
|
||||
}
|
||||
|
||||
$unformatted = @(gofmt -l pkgs module scripts)
|
||||
if ($unformatted.Count -gt 0) {
|
||||
throw ("gofmt required:" + [Environment]::NewLine + ($unformatted -join [Environment]::NewLine))
|
||||
}
|
||||
|
||||
$modules = @(go list -m -f '{{.Dir}}')
|
||||
if ($LASTEXITCODE -ne 0 -or $modules.Count -eq 0) {
|
||||
throw "未解析到任何工作区模块,go list -m 可能失败或返回空列表"
|
||||
}
|
||||
foreach ($module in $modules) {
|
||||
Write-Host "==> $module"
|
||||
Push-Location $module
|
||||
|
||||
Reference in New Issue
Block a user