src/Get-CciGetConfig.ps1
|
function Get-CciGetConfig { <# .SYNOPSIS Returns the merged cciget configuration (defaults + user overrides). .DESCRIPTION Configuration source-of-truth, in precedence order: 1. $env:CCIGET_CONFIG_PATH (file path) 2. %USERPROFILE%\.cciget\config.json 3. Built-in defaults (single feed: ccidev) The user file, if present, fully replaces the defaults (no deep merge) so operators can prune the default profile by writing their own. #> [CmdletBinding()] param() $path = _Get-CciGetConfigPath if (Test-Path -LiteralPath $path) { try { return (Get-Content -LiteralPath $path -Raw | ConvertFrom-Json) } catch { throw "cciget: failed to parse config at '$path': $_" } } _Get-CciGetDefaultConfig } |