Skip to content

Commit

Permalink
enhancement: Updating PipeScript.ezout
Browse files Browse the repository at this point in the history
Generating multiple partitioned files (Fixes #544).  Allowing formatting definitions within Types (Fixes #559)
  • Loading branch information
James Brundage committed Nov 6, 2023
1 parent be61d1e commit 67d48e2
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Build/PipeScript.ezout.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#requires -Module EZOut
# Install-Module EZOut or https://github.com/StartAutomating/EZOut
param()

$myFile = $MyInvocation.MyCommand.ScriptBlock.File
$myModuleName = 'PipeScript'
$myRoot = $myFile | Split-Path | Split-Path
Push-Location $myRoot
$formatting = @(
# Add your own Write-FormatView here,
# or put them in a Formatting or Views directory
foreach ($potentialDirectory in 'Formatting','Views') {
foreach ($potentialDirectory in 'Formatting','Views','Types') {
Join-Path $myRoot $potentialDirectory |
Get-ChildItem -ea ignore |
Import-FormatView -FilePath {$_.Fullname}
Expand All @@ -18,8 +20,12 @@ $destinationRoot = $myRoot

if ($formatting) {
$myFormatFile = Join-Path $destinationRoot "$myModuleName.format.ps1xml"
$formatting | Out-FormatData -Module $MyModuleName | Set-Content $myFormatFile -Encoding UTF8
Get-Item $myFormatFile

$formatting | Out-FormatData -Module $MyModuleName -OutputPath $MyFormatFile
$formatting | Out-FormatData -Module $MyModuleName -OutputPath ([Ordered]@{
"System.Management.Automation.*" = "$(Join-Path $destinationRoot "PipeScript.Extends.PowerShell.format.ps1xml")"
"Microsoft.CodeAnalysis.*" = "$(Join-Path $destinationRoot "PipeScript.Extends.CodeAnalysis.format.ps1xml")"
})
}

$types = @(
Expand All @@ -33,7 +39,11 @@ $types = @(

if ($types) {
$myTypesFile = Join-Path $destinationRoot "$myModuleName.types.ps1xml"
$types | Out-TypeData | Set-Content $myTypesFile -Encoding UTF8
Get-Item $myTypesFile

$types | Out-TypeData -OutputPath $myTypesFile
$types | Out-TypeData -OutputPath ([Ordered]@{
"System.Management.Automation.*" = "$(Join-Path $destinationRoot "PipeScript.Extends.PowerShell.types.ps1xml")"
"Microsoft.CodeAnalysis.*" = "$(Join-Path $destinationRoot "PipeScript.Extends.CodeAnalysis.types.ps1xml")"
})#>
}
Pop-Location

0 comments on commit 67d48e2

Please sign in to comment.