fixed scripts for dynamic path detection

This commit is contained in:
Boki 2025-06-13 07:44:15 -04:00
parent f2b77f38b4
commit 3227497e45
5 changed files with 67 additions and 10 deletions

View file

@ -2,6 +2,21 @@
Write-Host "Building and installing new libraries..." -ForegroundColor Cyan
# Find git root directory
try {
$gitRoot = git rev-parse --show-toplevel 2>$null
if ($LASTEXITCODE -ne 0) {
throw "Not in git repository"
}
# Convert Unix-style path to Windows if needed (for WSL/Git Bash compatibility)
if ($IsWindows -and $gitRoot -match "^/") {
$gitRoot = $gitRoot -replace "/", "\"
}
} catch {
Write-Host "Error: Not in a git repository. Please run this script from within the stock-bot git repository." -ForegroundColor Red
exit 1
}
# Build order is important due to dependencies
$libs = @(
"types", # Base types - no dependencies
@ -27,7 +42,7 @@ $libs = @(
# Build each library in order
foreach ($lib in $libs) {
$libPath = "g:\repos\stock-bot\libs\$lib"
$libPath = Join-Path $gitRoot "libs\$lib"
Write-Host "Building $lib..." -ForegroundColor Green
Set-Location $libPath
@ -40,4 +55,4 @@ foreach ($lib in $libs) {
}
Write-Host "All libraries built successfully!" -ForegroundColor Green
Set-Location g:\repos\stock-bot
Set-Location $gitRoot