@@ -30,6 +30,7 @@ if (-not $WorkingDirectory)
3030 }
3131 else { $WorkingDirectory = $env: SYSTEM_DEFAULTWORKINGDIRECTORY }
3232}
33+ if (-not $WorkingDirectory ) { $WorkingDirectory = Split-Path $PSScriptRoot }
3334# endregion Handle Working Directory Defaults
3435
3536# Prepare publish folder
@@ -42,19 +43,15 @@ $text = @()
4243$processed = @ ()
4344
4445# Gather Stuff to run before
45- foreach ($line in (Get-Content " $ ( $PSScriptRoot ) \filesBefore.txt " | Where-Object { $_ -notlike " #* " } ))
46+ foreach ($filePath in (& " $ ( $PSScriptRoot ) \..\þnameþ\internal\scripts\preimport.ps1 " ))
4647{
47- if ([string ]::IsNullOrWhiteSpace($line )) { continue }
48+ if ([string ]::IsNullOrWhiteSpace($filePath )) { continue }
4849
49- $basePath = Join-Path " $ ( $publishDir.FullName ) \þnameþ" $line
50- foreach ($entry in (Resolve-PSFPath - Path $basePath ))
51- {
52- $item = Get-Item $entry
53- if ($item.PSIsContainer ) { continue }
54- if ($item.FullName -in $processed ) { continue }
55- $text += [System.IO.File ]::ReadAllText($item.FullName )
56- $processed += $item.FullName
57- }
50+ $item = Get-Item $filePath
51+ if ($item.PSIsContainer ) { continue }
52+ if ($item.FullName -in $processed ) { continue }
53+ $text += [System.IO.File ]::ReadAllText($item.FullName )
54+ $processed += $item.FullName
5855}
5956
6057# Gather commands
@@ -66,19 +63,15 @@ Get-ChildItem -Path "$($publishDir.FullName)\þnameþ\functions\" -Recurse -File
6663}
6764
6865# Gather stuff to run afterwards
69- foreach ($line in (Get-Content " $ ( $PSScriptRoot ) \filesAfter.txt " | Where-Object { $_ -notlike " #* " } ))
66+ foreach ($filePath in (& " $ ( $PSScriptRoot ) \..\þnameþ\internal\scripts\postimport.ps1 " ))
7067{
71- if ([string ]::IsNullOrWhiteSpace($line )) { continue }
68+ if ([string ]::IsNullOrWhiteSpace($filePath )) { continue }
7269
73- $basePath = Join-Path " $ ( $publishDir.FullName ) \þnameþ" $line
74- foreach ($entry in (Resolve-PSFPath - Path $basePath ))
75- {
76- $item = Get-Item $entry
77- if ($item.PSIsContainer ) { continue }
78- if ($item.FullName -in $processed ) { continue }
79- $text += [System.IO.File ]::ReadAllText($item.FullName )
80- $processed += $item.FullName
81- }
70+ $item = Get-Item $filePath
71+ if ($item.PSIsContainer ) { continue }
72+ if ($item.FullName -in $processed ) { continue }
73+ $text += [System.IO.File ]::ReadAllText($item.FullName )
74+ $processed += $item.FullName
8275}
8376# endregion Gather text data to compile
8477
0 commit comments