Skip to content

Commit 78f2396

Browse files
🪲 [Fix]: Verify that folders exist (#60)
## Description - Verify that folders exist ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas
1 parent 9b1d39c commit 78f2396

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
Write-Verbose "[$manifestPropertyName] - Checking path for functions and filters"
2424

2525
$publicFolderPath = Join-Path -Path $SourceFolderPath -ChildPath 'functions/public'
26+
if (-not (Test-Path -Path $publicFolderPath -PathType Container)) {
27+
Write-Verbose "[$manifestPropertyName] - [Folder not found] - [$publicFolderPath]"
28+
return $functionsToExport
29+
}
2630
Write-Verbose "[$manifestPropertyName] - [$publicFolderPath]"
2731
$functionsToExport = [Collections.Generic.List[string]]::new()
2832
$scriptFiles = Get-ChildItem -Path $publicFolderPath -Recurse -File -ErrorAction SilentlyContinue -Include '*.ps1'

scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
Write-Verbose "[$manifestPropertyName]"
2323

2424
$variableFolderPath = Join-Path -Path $SourceFolderPath -ChildPath 'variables/public'
25+
if (-not (Test-Path -Path $variableFolderPath -PathType Container)) {
26+
Write-Verbose "[$manifestPropertyName] - [Folder not found] - [$variableFolderPath]"
27+
return $variablesToExport
28+
}
2529
$scriptFilePaths = Get-ChildItem -Path $variableFolderPath -Recurse -File -Filter *.ps1 | Select-Object -ExpandProperty FullName
2630

2731
$variablesToExport = [Collections.Generic.List[string]]::new()

0 commit comments

Comments
 (0)