Skip to content

Commit

Permalink
Add Files property to AUPackage
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
flcdrg committed Mar 31, 2024
1 parent 4990b79 commit d4823b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Private/AUPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class AUPackage {
[string] $IgnoreMessage
[string] $StreamsPath
[System.Collections.Specialized.OrderedDictionary] $Streams
[string[]] $Files

AUPackage([string] $Path ){
if ([String]::IsNullOrWhiteSpace( $Path )) { throw 'Package path can not be empty' }
Expand Down
3 changes: 3 additions & 0 deletions src/Public/Update-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ function Update-Package {
if (!(Test-Path $filePath)) { throw "Can't find file path to checksum" }

$item = Get-Item $filePath

$package.Files += $item.FullName

$type = if ($global:Latest.ContainsKey('ChecksumType' + $a)) { $global:Latest.Item('ChecksumType' + $a) } else { 'sha256' }
$hash = (Get-FileHash $item -Algorithm $type | ForEach-Object Hash).ToLowerInvariant()

Expand Down

0 comments on commit d4823b0

Please sign in to comment.