Skip to content

Commit 4b6d71d

Browse files
Fix install scripts and add .NET runtime requirement documentation (#69)
* Fix bash install script line endings and JSON parsing - Convert Windows CRLF line endings to Unix LF format - Redirect log output to stderr to prevent JSON corruption - Fix JSON parsing for single-line GitHub API responses - Update download URL extraction to handle compact JSON format * Fix PowerShell install script PATH variable syntax - Use ${InstallPath} syntax to properly escape colon in PATH export - Add file existence check before reading shell profile - Fix pattern matching for existing PATH entry detection * Add .NET runtime requirement documentation and checks - Add Prerequisites section to README explaining .NET 9 Runtime requirement - Add runtime detection to both install scripts with user warnings - Simplify installation instructions with one-liner commands - Move advanced install options to collapsible details section
1 parent c0a1a56 commit 4b6d71d

File tree

3 files changed

+336
-300
lines changed

3 files changed

+336
-300
lines changed

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,46 @@ link-validator --url https://example.com --output new-sitemap.md --diff old-site
3535

3636
## 📦 Installation
3737

38+
### Prerequisites
39+
40+
**Required:** [.NET 9 Runtime](https://dotnet.microsoft.com/download/dotnet/9.0) must be installed on your system to run LinkValidator.
41+
42+
- **Windows:** Download the [.NET 9 Runtime](https://dotnet.microsoft.com/download/dotnet/9.0/runtime)
43+
- **Linux/macOS:** Install via package manager or download from [Microsoft](https://dotnet.microsoft.com/download/dotnet/9.0)
44+
3845
### Option 1: Install Script (Recommended)
3946

4047
**Windows (PowerShell):**
4148
```powershell
42-
# Install to default location and add to PATH
4349
irm https://raw.githubusercontent.com/Aaronontheweb/link-validator/dev/install.ps1 | iex
50+
```
4451

52+
**Linux/macOS (Bash):**
53+
```bash
54+
curl -fsSL https://raw.githubusercontent.com/Aaronontheweb/link-validator/dev/install.sh | bash
55+
```
56+
57+
<details>
58+
<summary>Advanced installation options</summary>
59+
60+
**Windows custom options:**
61+
```powershell
4562
# Install to custom location
4663
irm https://raw.githubusercontent.com/Aaronontheweb/link-validator/dev/install.ps1 | iex -ArgumentList "-InstallPath", "C:\tools\linkvalidator"
4764
4865
# Install without adding to PATH
4966
irm https://raw.githubusercontent.com/Aaronontheweb/link-validator/dev/install.ps1 | iex -ArgumentList "-SkipPath"
5067
```
5168

52-
**Linux/macOS (Bash):**
69+
**Linux/macOS custom options:**
5370
```bash
54-
# Install to default location and add to PATH
55-
curl -fsSL https://raw.githubusercontent.com/Aaronontheweb/link-validator/dev/install.sh | bash
56-
5771
# Install to custom location
5872
curl -fsSL https://raw.githubusercontent.com/Aaronontheweb/link-validator/dev/install.sh | bash -s -- --dir ~/.local/bin
5973

6074
# Install without adding to PATH
6175
curl -fsSL https://raw.githubusercontent.com/Aaronontheweb/link-validator/dev/install.sh | bash -s -- --skip-path
6276
```
77+
</details>
6378

6479
### Option 2: Download Binary
6580

@@ -72,6 +87,8 @@ Download the appropriate binary from the [latest release](https://github.com/Aar
7287

7388
Extract and place the binary in your PATH.
7489

90+
**Note:** These binaries require the .NET 9 Runtime to be installed (see Prerequisites above).
91+
7592
### Option 3: Build from Source
7693

7794
**Prerequisites:** [.NET 9 SDK](https://dotnet.microsoft.com/download)

install.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ Write-Host "LinkValidator Installer" -ForegroundColor Green
7474
Write-Host "Platform: $Platform-$Architecture" -ForegroundColor Cyan
7575
Write-Host "Install Path: $InstallPath" -ForegroundColor Cyan
7676

77+
# Check for .NET runtime
78+
try {
79+
$null = & dotnet --version 2>$null
80+
} catch {
81+
Write-Host "`nWARNING: .NET runtime not detected!" -ForegroundColor Yellow
82+
Write-Host "LinkValidator requires .NET 9 Runtime to run." -ForegroundColor Yellow
83+
Write-Host "Download from: https://dotnet.microsoft.com/download/dotnet/9.0" -ForegroundColor Yellow
84+
Write-Host "Continuing with installation...`n" -ForegroundColor Cyan
85+
}
86+
7787
# Get latest release info or specific version
7888
if ($Version) {
7989
$ReleaseUrl = "$GITHUB_API_URL/releases/tags/$Version"
@@ -163,9 +173,9 @@ try {
163173
elseif (Test-Path ~/.bashrc) { "~/.bashrc" }
164174
else { "~/.profile" }
165175

166-
$PathLine = "export PATH=`"$InstallPath:\`$PATH`""
176+
$PathLine = "export PATH=`"${InstallPath}:\`$PATH`""
167177

168-
if (-not (Get-Content $ShellProfile -ErrorAction SilentlyContinue | Select-String -Pattern [regex]::Escape($InstallPath))) {
178+
if (-not (Test-Path $ShellProfile) -or -not (Get-Content $ShellProfile -ErrorAction SilentlyContinue | Select-String -Pattern ([regex]::Escape($InstallPath)))) {
169179
Add-Content -Path $ShellProfile -Value $PathLine
170180
Write-Host "✓ Added to $ShellProfile. Run 'source $ShellProfile' or restart your terminal." -ForegroundColor Green
171181
} else {

0 commit comments

Comments
 (0)