Spaces:
Running
Running
Download tools/git/pull-scope.ps1 from tkadkghdlf/CD: direct link, hf CLI and curl.
- Browser
- Download file 590 Bytes
-
https://huggingface.co/spaces/tkadkghdlf/CD/resolve/main/tools/git/pull-scope.ps1
- Command line
-
hf download hf://spaces/tkadkghdlf/CD/tools/git/pull-scope.ps1
-
curl -L -o pull-scope.ps1 https://huggingface.co/spaces/tkadkghdlf/CD/resolve/main/tools/git/pull-scope.ps1
590 Bytes
| param( | |
| [Parameter(Mandatory = $true)] | |
| [string]$Branch, | |
| [Parameter(Mandatory = $true)] | |
| [string[]]$Scope | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| $remoteRef = "origin/$Branch" | |
| Write-Host "[pull-scope] fetch $remoteRef" | |
| git fetch origin $Branch | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "git fetch failed for branch: $Branch" | |
| } | |
| foreach ($path in $Scope) { | |
| Write-Host "[pull-scope] apply $path from $remoteRef" | |
| git restore --source $remoteRef --staged --worktree -- $path | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "git restore failed for scope: $path" | |
| } | |
| } | |
| Write-Host "[pull-scope] completed" | |