Skip to content

Commit

Permalink
Move shared app functions into Shared
Browse files Browse the repository at this point in the history
Different directory structure for shared app functions from module private functions
  • Loading branch information
aaronparker committed Sep 20, 2023
1 parent ebc2e3a commit 86beb57
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Evergreen/Evergreen.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
param ()

#region Get public and private function definition files
$publicRoot = Join-Path -Path $PSScriptRoot -ChildPath "Public"
$privateRoot = Join-Path -Path $PSScriptRoot -ChildPath "Private"
$Public = @( Get-ChildItem -Path (Join-Path $publicRoot "*.ps1") -ErrorAction "SilentlyContinue" )
$Private = @( Get-ChildItem -Path (Join-Path $privateRoot "*.ps1") -ErrorAction "SilentlyContinue" )
$PublicRoot = Join-Path -Path $PSScriptRoot -ChildPath "Public"
$PrivateRoot = Join-Path -Path $PSScriptRoot -ChildPath "Private"
$SharedRoot = Join-Path -Path $PSScriptRoot -ChildPath "Shared"
$Public = @( Get-ChildItem -Path (Join-Path -Path $PublicRoot -ChildPath "*.ps1") -ErrorAction "SilentlyContinue" )
$Private = @( Get-ChildItem -Path (Join-Path -Path $PrivateRoot -ChildPath "*.ps1") -ErrorAction "SilentlyContinue" )
$Shared = @( Get-ChildItem -Path (Join-Path -Path $SharedRoot -ChildPath "*.ps1") -ErrorAction "SilentlyContinue" )

# Dot source the files
foreach ($import in @($Public + $Private)) {
foreach ($Import in @($Public + $Private + $Shared)) {
try {
. $import.FullName
. $Import.FullName
}
catch {
throw $_
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 86beb57

Please sign in to comment.