-
Notifications
You must be signed in to change notification settings - Fork 0
✨ feat: add relative paths robustet install, docs updates #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,6 +128,20 @@ function Normalize-RuleId { | |
| return $normalized.Trim('-').ToLowerInvariant() | ||
| } | ||
|
|
||
| function Get-RelativePath { | ||
| param( | ||
| [Parameter(Mandatory)] | ||
| [string]$Path, | ||
| [Parameter(Mandatory)] | ||
| [string]$BasePath | ||
| ) | ||
| $pathUri = New-Object System.Uri($Path) | ||
| $baseUri = New-Object System.Uri($BasePath) | ||
| $relativeUri = $baseUri.MakeRelativeUri($pathUri) | ||
| $relativePath = [System.Uri]::UnescapeDataString($relativeUri.ToString()) | ||
| return $relativePath -replace '/', '\' | ||
| } | ||
|
|
||
| function Get-BackupRules { | ||
| param([object]$Config) | ||
|
|
||
|
|
@@ -339,7 +353,7 @@ foreach ($rule in $rules) { | |
| restorePath = $rule.restorePath | ||
| kind = $rule.kind | ||
| tags = $rule.tags | ||
| backupPath = $ruleDestination | ||
| backupPath = Get-RelativePath -Path $ruleDestination -BasePath $sessionRoot | ||
| success = $copyResult.Success | ||
| message = $copyResult.Message | ||
| }) | ||
|
|
@@ -371,7 +385,7 @@ foreach ($repoFile in $repoFiles) { | |
| $entry = [ordered]@{ | ||
| relativePath = $repoFile.relativePath | ||
| source = $repoFile.source | ||
| backupPath = $destination | ||
| backupPath = Get-RelativePath -Path $destination -BasePath $sessionRoot | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This change writes Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| if ($VerifyHashes -and (Test-Path $destination)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching from
winget importof a filtered manifest towinget install <PackageIdentifier>drops manifest-level constraints (for example source selection and any pinned metadata in exported manifests). In manifests that rely on those fields, installs can come from the wrong source or wrong version, which breaks the declarative/reproducible behavior this step is intended to provide.Useful? React with 👍 / 👎.