Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileProvider uses note properties for better error handling. #144

Closed
wants to merge 2 commits into from
Closed
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed `ConvertTo-Datum` always returns `$null` when DatumHandler returns `$false` (#139)
- Fixed `ConvertTo-Datum` always returns `$null` when DatumHandler returns `$false` (#139).
- Datum will throw errors when loading the data by moving from script properties to note properties (#143).

## [0.40.1] - 2023-04-03

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stages:
vmImage: 'ubuntu-latest'
steps:
- pwsh: |
dotnet tool install --global GitVersion.Tool
dotnet tool install --global GitVersion.Tool --version 5.*
$gitVersionObject = dotnet-gitversion | ConvertFrom-Json
$gitVersionObject.PSObject.Properties.ForEach{
Write-Host -Object "Setting Task Variable '$($_.Name)' with value '$($_.Value)'."
Expand Down
10 changes: 5 additions & 5 deletions source/Classes/FileProvider.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ class FileProvider : DatumProvider
$this.DatumHandlers = $DatumHierarchyDefinition.DatumHandlers
$this.Encoding = $Encoding

$result = Get-ChildItem -Path $path | ForEach-Object {
$null = Get-ChildItem -Path $path | ForEach-Object {
if ($_.PSIsContainer)
{
$val = [scriptblock]::Create("New-DatumFileProvider -Path `"$($_.FullName)`" -Store `$this.DataOptions -DatumHierarchyDefinition `$this.DatumHierarchyDefinition -Encoding `$this.Encoding")
$this | Add-Member -MemberType ScriptProperty -Name $_.BaseName -Value $val
$val = New-DatumFileProvider -Path $_.FullName -Store $this.DataOptions -DatumHierarchyDefinition $this.DatumHierarchyDefinition -Encoding $this.Encoding
$this | Add-Member -MemberType NoteProperty -Name $_.BaseName -Value $val
}
else
{
$val = [scriptblock]::Create("Get-FileProviderData -Path `"$($_.FullName)`" -DatumHandlers `$this.DatumHandlers -Encoding `$this.Encoding")
$this | Add-Member -MemberType ScriptProperty -Name $_.BaseName -Value $val
$val = Get-FileProviderData -Path $_.FullName -DatumHandlers $this.DatumHandlers -Encoding $this.Encoding
$this | Add-Member -MemberType NoteProperty -Name $_.BaseName -Value $val
}
}
}
Expand Down