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

@ -12,7 +12,24 @@ Write-Host "🚀 Starting complete build process..." -ForegroundColor Cyan
# Store original location
$originalLocation = Get-Location
Set-Location "g:\repos\stock-bot"
# 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
Set-Location $originalLocation
exit 1
}
Set-Location $gitRoot
try {
# Step 1: Clean if requested