Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103# Create a new Perforce workspace for local Windows builds# Simplified version with hardcoded depot mapping
$ErrorActionPreference = "Stop"
Write-Host "=========================================" -ForegroundColor CyanWrite-Host "Create Perforce Workspace for SpiderLily" -ForegroundColor CyanWrite-Host "=========================================" -ForegroundColor CyanWrite-Host ""
# Set Perforce environment$env:P4PORT = "ssl:falsework.helixcore.io:1666"$env:P4USER = "machine"
# Get computer name for unique workspace$hostname = $env:COMPUTERNAME.ToLower()$workspaceName = "spiderlily_windows_$hostname"$workspaceRoot = "C:\Perforce\SpiderLily"
Write-Host "Server: $env:P4PORT" -ForegroundColor CyanWrite-Host "User: $env:P4USER" -ForegroundColor CyanWrite-Host "New Workspace: $workspaceName" -ForegroundColor CyanWrite-Host "Root Directory: $workspaceRoot" -ForegroundColor CyanWrite-Host ""
# Create workspace directoryif (!(Test-Path $workspaceRoot)) { Write-Host "Creating directory: $workspaceRoot" -ForegroundColor Yellow New-Item -ItemType Directory -Path $workspaceRoot -Force | Out-Null}
# Check if workspace already exists$existingClient = p4 clients -e $workspaceName 2>$nullif ($existingClient) { Write-Host "[OK] Workspace '$workspaceName' already exists" -ForegroundColor Green $env:P4CLIENT = $workspaceName Write-Host "" Write-Host "Ready to sync! Run:" -ForegroundColor Cyan Write-Host " p4 sync" -ForegroundColor White Write-Host "" Write-Host "Or continue with the build process." -ForegroundColor Yellow exit 0}
Write-Host "Creating new workspace..." -ForegroundColor YellowWrite-Host ""
# Create workspace spec with standard SpiderLily mapping$clientSpec = @"Client: $workspaceName
Owner: $env:P4USER
Host: $hostname
Description: Local Windows build workspace for SpiderLily
Root: $workspaceRoot
Options: noallwrite noclobber nocompress unlocked nomodtime normdir
SubmitOptions: submitunchanged
LineEnd: local
View: //SpiderLily/... //$workspaceName/..."@
# Create client using piped input$clientSpec | p4 client -i
if ($LASTEXITCODE -ne 0) { Write-Host "" Write-Host "[ERROR] Failed to create workspace!" -ForegroundColor Red Write-Host "" Write-Host "Try creating manually with P4V:" -ForegroundColor Yellow Write-Host " 1. Open P4V" -ForegroundColor Gray Write-Host " 2. Connection -> New Workspace" -ForegroundColor Gray Write-Host " 3. Name: $workspaceName" -ForegroundColor Gray Write-Host " 4. Root: $workspaceRoot" -ForegroundColor Gray Write-Host " 5. Add view: //SpiderLily/... //$workspaceName/..." -ForegroundColor Gray exit 1}
Write-Host ""Write-Host "[OK] Workspace created successfully!" -ForegroundColor GreenWrite-Host ""Write-Host "Workspace: $workspaceName" -ForegroundColor CyanWrite-Host "Root: $workspaceRoot" -ForegroundColor CyanWrite-Host ""Write-Host "Next: Sync the files" -ForegroundColor YellowWrite-Host " Run: " -ForegroundColor GrayWrite-Host " `$env:P4CLIENT = '$workspaceName'" -ForegroundColor WhiteWrite-Host " p4 sync" -ForegroundColor WhiteWrite-Host ""
# Set for this session$env:P4CLIENT = $workspaceNameWrite-Host "[OK] Environment configured for this session" -ForegroundColor GreenWrite-Host ""