Files
Hua.Cli/scripts/install-local.ps1
ShaoHua 734b2c91f9 build: 升级目标框架到net10.0并完善模板配置
1. 将Hua.Cli.Tests、项目共享库、模块项目等所有项目的TargetFramework从net8.0/net9.0升级到net10.0
2. 完善dotnet-tools.json、模板配置文件,添加必要的构建和发布配置
3. 新增微服务、网关、应用程序的启动脚本和基础配置文件
4. 补充产品管理模块的领域、应用、Web层基础代码和多语言资源
2026-07-16 02:43:29 +08:00

30 lines
909 B
PowerShell

param(
[string]$PackagePath = "$PSScriptRoot\..\src\Hua.Cli\bin\Debug\Hua.Cli.0.0.3.nupkg"
)
Write-Host "== Hua.Cli 本地安装 ==" -ForegroundColor Cyan
Write-Host "编译并打包..." -ForegroundColor Yellow
$projPath = "$PSScriptRoot\..\src\Hua.Cli\Hua.Cli.csproj"
dotnet build $projPath -c Debug
dotnet pack $projPath -c Debug -o (Split-Path $PackagePath -Parent) --no-build
if (-not (Test-Path $PackagePath)) {
Write-Host "包文件不存在: $PackagePath" -ForegroundColor Red
exit 1
}
$nupkgDir = Split-Path $PackagePath -Parent
Write-Host "包路径: $PackagePath" -ForegroundColor Gray
Write-Host "卸载旧版本..." -ForegroundColor Yellow
dotnet tool uninstall -g Hua.Cli 2>$null
Write-Host "安装本地版本..." -ForegroundColor Green
dotnet tool install -g Hua.Cli --add-source $nupkgDir --prerelease
Write-Host "== 完成 ==" -ForegroundColor Cyan
Write-Host ""
hua help