Skip to content

Commit

Permalink
fix: 修复插件环境构建脚本无法设置环境变量的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloWRC committed Oct 13, 2024
1 parent af0cf67 commit 0cc006e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tools/plugin/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ $classIslandRoot = "$([System.IO.Path]::GetDirectoryName($scriptPath))\..\..\Cla

function SetEnvironmentVariable {
param (
$Name,
$Value,
$Scope="User"
$Name, $Value
)
$out = "$Name = $Value"
Write-Host $out -ForegroundColor DarkGray
[Environment]::SetEnvironmentVariable($Name, $Value, $Scope)
[Environment]::SetEnvironmentVariable($Name, $Value, 1)
}

Set-Location $classIslandRoot
Expand All @@ -39,7 +37,7 @@ catch {

Write-Host "🔧 正在设置开发环境变量…" -ForegroundColor Cyan

SetEnvironmentVariable("ClassIsland_DebugBinaryFile", [System.IO.Path]::GetFullPath("${classIslandRoot}\bin\Debug\net8.0-windows\ClassIsland.exe"))
SetEnvironmentVariable("ClassIsland_DebugBinaryDirectory", [System.IO.Path]::GetFullPath("${classIslandRoot}/bin\Debug\net8.0-windows\"))
[Environment]::SetEnvironmentVariable("ClassIsland_DebugBinaryFile", [System.IO.Path]::GetFullPath("${classIslandRoot}\bin\Debug\net8.0-windows\ClassIsland.exe"), 1)
[Environment]::SetEnvironmentVariable("ClassIsland_DebugBinaryDirectory", [System.IO.Path]::GetFullPath("${classIslandRoot}/bin\Debug\net8.0-windows\"), 1)

Write-Host "构建完成" -ForegroundColor Green

0 comments on commit 0cc006e

Please sign in to comment.