-
Notifications
You must be signed in to change notification settings - Fork 0
Update install.ps1 #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -436,17 +436,17 @@ function Test-Requirements { | |
| try { | ||
| $kernel = docker info --format '{{.KernelVersion}}' 2>$null | ||
| Write-Verbose "KernelVersion='$kernel'" | ||
| if ($kernel -match 'microsoft|WSL2') | ||
| { | ||
| Write-InfoLog "Detected Docker is using WSL2." | ||
| } elseif ($kernel -match 'linuxkit') { | ||
| if ($kernel -match 'microsoft|WSL2') | ||
| { | ||
| Write-InfoLog "Detected Docker is using WSL2." | ||
| } elseif ($kernel -match 'linuxkit') { | ||
| $script:ERROR_CODE = 4 | ||
| Write-WarnLog "Detected Docker is using Hyper-V, please reinstall Docker with WSL2. Hyper-V is not supported. Use at your own risk!" | ||
| } else { | ||
| $script:ERROR_CODE = 5 | ||
| Write-WarnLog "Cannot determine if Docker is using WSL2. Please ensure Docker is using WSL2." | ||
| } | ||
| } catch { | ||
| } catch { | ||
| $script:ERROR_CODE = 5 | ||
| Write-WarnLog "docker info failed. Cannot determine if Docker is using WSL2. Please ensure Docker is using WSL2." | ||
| } | ||
|
|
@@ -468,7 +468,7 @@ function Test-Requirements { | |
|
|
||
| # Check network connectivity | ||
| try { | ||
| $response = Invoke-WebRequest -Uri "https://install.rocketgraph.com" -Method Head | ||
| $response = Invoke-WebRequest -Uri "https://install.rocketgraph.com" -Method Head -UseBasicParsing | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The URL |
||
| if ($response.StatusCode -ne 200) { | ||
| throw "Non-200 status code" | ||
| } | ||
|
|
@@ -585,13 +585,13 @@ function Get-ConfigurationFiles { | |
| $changes = $false | ||
| Write-InfoLog "Checking for potentially new keys added to env.template since initial install." | ||
| Write-InfoLog "This may help identify missing entries in .env, but some may be false positives." | ||
|
|
||
| $existing = Get-Content ".env" | ||
| $template = Get-Content "env.template" | ||
|
|
||
| foreach ($line in $template) { | ||
| if ($line -match '^\s*$|^\s*#') { continue } # Skip empty lines and comments | ||
|
|
||
| $key = ($line -split '=')[0] | ||
| if (-not ($existing -match "^$key=")) { | ||
| Write-WarnLog "Key '$key' is present in env.template but not found in .env. If this key is new, consider adding it:" | ||
|
|
@@ -702,4 +702,4 @@ try { | |
| } | ||
| } | ||
|
|
||
| exit $ERROR_CODE | ||
| exit $ERROR_CODE | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script's exit logic can be simplified and made more consistent. The try {
Start-Installation
} catch {
Write-ErrorLog "Script error: $_"
$script:ERROR_CODE = 1
}
Exit-Script $script:ERROR_CODEThis would replace lines 696-705, remove the |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the
elseifandelseblocks that follow, consider placing the opening brace on the same line as theifstatement. This improves readability by maintaining a consistent style throughout the conditional block.