Skip to content

Commit

Permalink
Add binaries (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasNieto authored Aug 15, 2024
1 parent a7f6a4b commit 6790174
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 3 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cSpell.words": [
"isnot",
"Nieto"
]
}
2 changes: 1 addition & 1 deletion SignSettings.psd1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
FilePath = @('Scoop.psd1', 'Scoop.psm1')
FilePath = @('Scoop.psd1', 'Scoop.psm1', 'Scoop.format.ps1xml')
TimeStampServer = 'http://timestamp.sectigo.com'
HashAlgorithm = 'SHA256'
}
71 changes: 71 additions & 0 deletions src/Scoop.format.ps1xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<Configuration>
<ViewDefinitions>
<View>
<Name>Default</Name>
<ViewSelectedBy>
<TypeName>ScoopAppDetailed</TypeName>
<TypeName>Deserialized.ScoopAppDetailed</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Width>20</Width>
</TableColumnHeader>
<TableColumnHeader>
<Width>10</Width>
</TableColumnHeader>
<TableColumnHeader>
<Width>10</Width>
</TableColumnHeader>
<TableColumnHeader>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Version</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Source</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Description</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Default</Name>
<ViewSelectedBy>
<TypeName>ScoopAppDetailed</TypeName>
<TypeName>Deserialized.ScoopAppDetailed</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<PropertyName>Name</PropertyName>
</ListItem>
<ListItem>
<PropertyName>Version</PropertyName>
</ListItem>
<ListItem>
<PropertyName>Source</PropertyName>
</ListItem>
<ListItem>
<PropertyName>Description</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
</ViewDefinitions>
</Configuration>
5 changes: 3 additions & 2 deletions src/Scoop.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'Scoop.psm1'
ModuleVersion = '0.1.3'
ModuleVersion = '0.2.0'
CompatiblePSEditions = @('Desktop', 'Core')
GUID = '7603664e-144c-4083-a51d-399df057a37d'
Author = 'Thomas Nieto'
Expand All @@ -12,7 +12,8 @@
'Register-ScoopBucket', 'Unregister-ScoopBucket')
CmdletsToExport = @()
AliasesToExport = @()
FileList = @('Scoop.psd1', 'Scoop.psm1')
FormatsToProcess = @('Scoop.format.ps1xml')
FileList = @('Scoop.psd1', 'Scoop.psm1', 'Scoop.format.ps1xml')
PrivateData = @{
PSData = @{
Tags = @('Scoop', 'Windows')
Expand Down
13 changes: 13 additions & 0 deletions src/Scoop.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class ScoopAppDetailed {
[string] $Version
[string] $Source
[string] $Description
[string] $Homepage
[string[]] $Binaries
}

<#
Expand All @@ -24,6 +26,7 @@ class ScoopAppDetailed {
#>
function Find-ScoopApp {
[CmdletBinding()]
[OutputType([ScoopAppDetailed])]
param (
[Parameter(Position = 0,
ValueFromPipeline,
Expand Down Expand Up @@ -58,11 +61,21 @@ function Find-ScoopApp {
ForEach-Object {
$value = $_ | Get-Content | ConvertFrom-Json

$binaries = if ($value.Bin) {
$value.Bin |
Where-Object { $_ -isnot [object[]] } |
Split-Path -Leaf
} else {
$null
}

[ScoopAppDetailed]@{
Name = $_.BaseName
Version = $value.Version
Source = ($_.Directory | Split-Path -Parent | Split-Path -Leaf)
Description = $value.Description
Binaries = $binaries
Homepage = $value.Homepage
}
}
}
Expand Down

0 comments on commit 6790174

Please sign in to comment.