Spaces:
Running
Running
Download tools/git/commit-scope.ps1 from tkadkghdlf/CD: direct link, hf CLI and curl.
- Browser
- Download file 541 Bytes
-
https://huggingface.co/spaces/tkadkghdlf/CD/resolve/main/tools/git/commit-scope.ps1
- Command line
-
hf download hf://spaces/tkadkghdlf/CD/tools/git/commit-scope.ps1
-
curl -L -o commit-scope.ps1 https://huggingface.co/spaces/tkadkghdlf/CD/resolve/main/tools/git/commit-scope.ps1
541 Bytes
| param( | |
| [Parameter(Mandatory = $true)] | |
| [string]$Message, | |
| [Parameter(Mandatory = $true)] | |
| [string[]]$Scope | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| foreach ($path in $Scope) { | |
| Write-Host "[commit-scope] stage $path" | |
| git add -- $path | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "git add failed for scope: $path" | |
| } | |
| } | |
| git diff --cached --quiet | |
| if ($LASTEXITCODE -eq 0) { | |
| throw "No staged changes in selected scope." | |
| } | |
| git commit -m $Message | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "git commit failed." | |
| } | |
| Write-Host "[commit-scope] completed" | |