From d54601901b75ada59984fe5a39faee1b2c228cff Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Thu, 7 Mar 2024 20:52:52 -0600 Subject: [PATCH] fix --- sources/identity/build-libsql.ps1 | 8 ++++++-- sources/identity/import-lib.ps1 | 12 +++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sources/identity/build-libsql.ps1 b/sources/identity/build-libsql.ps1 index eb3bbbf7..2ea3b7e0 100644 --- a/sources/identity/build-libsql.ps1 +++ b/sources/identity/build-libsql.ps1 @@ -96,12 +96,16 @@ try { if (-not $SkipBuildTempl) { Install-Templ -Force:$ForceInstallTempl + $goBinPath = Join-Path (go env GOPATH) "bin" + Write-Verbose "goBinPath: $goBinPath" + $templCommand = Join-Path $goBinPath "templ" + Write-Verbose "templCommand: $templCommand" Write-Verbose "templ fmt" - templ fmt . + ."$templCommand" fmt . Write-Verbose "templ generate" - $generateOutput = templ generate + $generateOutput = ."$templCommand" generate Write-Verbose "templ generate output:" $generateOutput -split "`n" | ForEach-Object { Write-Verbose ($_ -replace "\(Γ£ù\)", "❌" -replace "\(Γ£ô\)", "✅") } diff --git a/sources/identity/import-lib.ps1 b/sources/identity/import-lib.ps1 index 9b7348d9..4a2a13de 100644 --- a/sources/identity/import-lib.ps1 +++ b/sources/identity/import-lib.ps1 @@ -33,7 +33,11 @@ try { param( [switch]$Force ) - $templCommand = "templ" + $goBinPath = Join-Path (go env GOPATH) "bin" + Write-Verbose "goBinPath: $goBinPath" + + $templCommand = Join-Path $goBinPath "templ" + Write-Verbose "templCommand: $templCommand" try { $output = & $templCommand --version @@ -51,12 +55,6 @@ try { Write-Verbose "go install github.com/a-h/templ/cmd/templ@latest" go install github.com/a-h/templ/cmd/templ@latest - $goBinPath = Join-Path (go env GOPATH) "bin" - if (-Not $goBinPath) { - $goBinPath = go env GOBIN - } - Write-Verbose "goBinPath: $goBinPath" - if (-Not ($env:PATH -split ';' -contains $goBinPath)) { Write-Verbose "Adding Go bin path to the current session PATH..." $env:PATH += ";$goBinPath"