Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion public/items/project_item_show.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,14 @@ function ShowAttribLine{

$AttributesToShow | ForEach-Object {
$name = $_.Name
$value = $_.Value
$color = $_.Color
$prefix = $_.Prefix
$BetweenQuotes = $_.BetweenQuotes
$DefaultValue = $_.DefaultValue ?? "[$name]"
$HideIfEmpty = $_.HideIfEmpty

$value = $item.$name
$value = $value ?? $item.$name

if($HideIfEmpty -and [string]::IsNullOrEmpty($value)){
return
Expand Down
14 changes: 12 additions & 2 deletions public/items/use_order.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function Use-Order {
[Parameter()][Alias("e")][switch]$OpenInEditor,
[Parameter()][Alias("w")][switch]$OpenInBrowser,
[Parameter()][Alias("p")][switch]$PassThru,
[Parameter()][Alias("c")][switch]$ClearScreen
[Parameter()][Alias("c")][switch]$ClearScreen,
[Parameter()][scriptblock]$ShowProjectItemScriptBlock
)

begin {
Expand Down Expand Up @@ -54,8 +55,17 @@ function Use-Order {
return [PsCustomObject]$i
}

# Get function to show item
$ShowProjectItemScriptBlock = $ShowProjectItemScriptBlock ?? { param($parameters) Show-ProjectItem @parameters }

# Show item in console or editor
Show-ProjectItem -Item $itemId -OpenInEditor:$OpenInEditor -OpenInBrowser:$OpenInBrowser -ClearScreen:$ClearScreen
$params = @{
Item = $itemId
OpenInEditor = $OpenInEditor
OpenInBrowser = $OpenInBrowser
ClearScreen = $ClearScreen
}
$ShowProjectItemScriptBlock.Invoke($params)
return

}
Expand Down
Loading