You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
|
|
|
$gitIgnorePath = "$PSScriptRoot/.gitignore"
|
|
|
|
|
|
|
|
Function gig {
|
|
|
|
param(
|
|
|
|
[Parameter(Mandatory=$true)]
|
|
|
|
[string[]]$list
|
|
|
|
)
|
|
|
|
$params = ($list | ForEach-Object { [uri]::EscapeDataString($_) }) -join ","
|
|
|
|
Invoke-WebRequest -Uri "https://www.toptal.com/developers/gitignore/api/$params" | `
|
|
|
|
Select-Object -ExpandProperty content | `
|
|
|
|
Set-Content -Path $gitIgnorePath -Encoding utf8 -NoNewline
|
|
|
|
}
|
|
|
|
|
|
|
|
gig windows,jetbrains,csharp,macos,sonarqube
|
|
|
|
|
|
|
|
# Replace specific ignore patterns
|
|
|
|
$(Get-Content $gitIgnorePath) `
|
|
|
|
-replace '^\.idea', '**/.idea' `
|
|
|
|
| Set-Content -Path $gitIgnorePath
|