diff --git a/ccs.ps1 b/ccs.ps1 index cdd5ef31..3e058ebd 100644 --- a/ccs.ps1 +++ b/ccs.ps1 @@ -79,7 +79,14 @@ $SettingsPath = $SettingsPath -replace '/', '\' if (-not (Test-Path $SettingsPath)) { Write-Host "Error: Settings file not found: $SettingsPath" -ForegroundColor Red Write-Host "" - Write-Host "Create the settings file or update the path in $ConfigFile" + Write-Host "Solutions:" -ForegroundColor Yellow + Write-Host " 1. Create the settings file with empty env:" + Write-Host " New-Item -ItemType File -Force -Path '$SettingsPath'" + Write-Host " Set-Content -Path '$SettingsPath' -Value '{`"env`":{}}`'" + Write-Host "" + Write-Host " 2. Or update profile path in $ConfigFile" + Write-Host "" + Write-Host " 3. Or reinstall: irm ccs.kaitran.ca/install.ps1 | iex" exit 1 } @@ -89,6 +96,15 @@ try { $Settings = $SettingsContent | ConvertFrom-Json -ErrorAction Stop } catch { Write-Host "Error: Invalid JSON in $SettingsPath" -ForegroundColor Red + Write-Host "" + Write-Host "Details: $_" -ForegroundColor Yellow + Write-Host "" + Write-Host "Solutions:" -ForegroundColor Yellow + Write-Host " 1. Validate JSON at https://jsonlint.com" + Write-Host " 2. Or reset to template:" + Write-Host " Set-Content -Path '$SettingsPath' -Value '{`"env`":{}}`'" + Write-Host "" + Write-Host " 3. Or reinstall: irm ccs.kaitran.ca/install.ps1 | iex" exit 1 } diff --git a/install.ps1 b/install.ps1 index 7e7b21bd..e32b4bb1 100644 --- a/install.ps1 +++ b/install.ps1 @@ -232,6 +232,16 @@ if (-not (Test-Path $SonnetSettings)) { Write-Host "| [OK] Sonnet profile exists: $SonnetSettings" } +# Ensure default profile settings file exists +$DefaultSettings = "$ClaudeDir\settings.json" +if (-not (Test-Path $DefaultSettings)) { + New-Item -ItemType Directory -Force -Path $ClaudeDir | Out-Null + @{ env = @{} } | ConvertTo-Json -Depth 10 | Set-Content $DefaultSettings + Write-Host "| [OK] Created default settings: $DefaultSettings" +} else { + Write-Host "| [OK] Default profile exists: $DefaultSettings" +} + Write-Host "└─" Write-Host ""