Update setup.ps1 - #349
Conversation
WalkthroughThe changes simplify the setup process in the Changes
Sequence Diagram(s)sequenceDiagram
participant S as setup.ps1
participant NET as .NET Checker
participant EF as dotnet-ef Installer
participant RUN as Dotnet Runner
participant GH as GitHub Server Files
S->>NET: Check .NET version
NET-->>S: Version validated
S->>EF: Install dotnet-ef tool globally
S->>S: Create .env file
S->>RUN: Execute "dotnet run" (navmesh prompts removed)
S->>GH: Download customized server files via Invoke-WebRequest
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
setup.ps1 (3)
41-42: Improve error handling for dotnet-ef tool installationThe script installs the dotnet-ef tool globally without checking if it's already installed, which could lead to error messages if the tool exists. Consider adding a check before installation and providing user feedback.
- dotnet tool install --global dotnet-ef + Write-Host "Installing dotnet-ef tool..." -ForegroundColor Blue + dotnet tool install --global dotnet-ef --verbosity quiet 2>$null || Write-Host "dotnet-ef is already installed." -ForegroundColor Green
142-143: Add comments explaining the dotnet run stepNow that the navmesh generation step has been removed, the purpose of this
dotnet runcommand may not be clear to future maintainers. Consider adding a comment explaining what this command does.# Run ingest - dotnet run + # Run ingest (processes game files without navmesh generation) + Write-Host "Processing game files..." -ForegroundColor Blue + dotnet run + Write-Host "Processing complete!" -ForegroundColor Green
147-154: Verify file integrity after downloadThe script downloads server files but doesn't verify if the downloads were successful or if the files are valid. Consider adding a basic file size check to ensure the downloads completed properly.
+ # Add after the download loop + Write-Host "Verifying downloaded files..." -ForegroundColor Blue + $allFilesValid = $true + foreach ($file in $files) { + $filePath = Join-Path $dataPath $file.Name + if (Test-Path $filePath) { + $fileSize = (Get-Item $filePath).Length + if ($fileSize -lt 1024) { # Files should be at least 1KB + Write-Host "Warning: $($file.Name) seems too small ($fileSize bytes). It may be incomplete." -ForegroundColor Yellow + $allFilesValid = $false + } + } else { + Write-Host "Error: $($file.Name) was not downloaded successfully." -ForegroundColor Red + $allFilesValid = $false + } + } + + if ($allFilesValid) { + Write-Host "All server files were downloaded successfully!" -ForegroundColor Green + } else { + Write-Host "Some server files may be missing or incomplete. The setup may not work correctly." -ForegroundColor Yellow + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
setup.ps1(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
this change removes the no longer needed navmesh step and adds new steps to download dotnet-ef as well as the customized server files
Summary by CodeRabbit