Skip to content

Commit df9c06e

Browse files
committed
Added more debug outputs across all functions
1 parent ccaf15e commit df9c06e

File tree

10 files changed

+24
-1
lines changed

10 files changed

+24
-1
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"powershell"
2121
],
2222
"cSpell.words": [
23+
"gldata",
2324
"jakemorrison",
2425
"Pscx",
2526
"shortcode"

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- Module Changes
1111
- Updated to use Unicode Version: 16.0 (was previously Unicode Version: 15.1)
12+
- Added more debug outputs across all functions
1213
- Build Updates
1314
- Improved integration tests
1415
- Updated tests to follow Pester 5 rules

src/pwshEmojiExplorer/Private/Confirm-DataLocation.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function Confirm-DataLocation {
2020
)
2121
$result = $true #assume the best
2222
Write-Verbose -Message 'Verifying data set output location...'
23+
Write-Debug -Message ('Data path: {0}' -f $script:dataPath)
2324
try {
2425
$pathEval = Test-Path -Path $script:dataPath -ErrorAction Stop
2526
}
@@ -29,6 +30,8 @@ function Confirm-DataLocation {
2930
return $result
3031
}
3132

33+
Write-Debug -Message ('Path evaluation: {0}' -f $pathEval)
34+
3235
if (-not ($pathEval)) {
3336
Write-Verbose -Message 'Creating output directory...'
3437
try {

src/pwshEmojiExplorer/Private/Confirm-MetadataUpdate.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function Confirm-MetadataUpdate {
2222

2323
Write-Verbose -Message 'Checking for metadata file...'
2424
$localMetaDataFilePath = [System.IO.Path]::Combine($script:dataPath, $script:metadataFile)
25+
Write-Debug -Message ('Metadata file path: {0}' -f $localMetaDataFilePath)
2526
try {
2627
$pathEval = Test-Path -Path $localMetaDataFilePath -ErrorAction Stop
2728
}
@@ -33,6 +34,7 @@ function Confirm-MetadataUpdate {
3334

3435
if (-not ($pathEval)) {
3536
$result = $false
37+
Write-Debug -Message 'Metadata file not found.'
3638
} #if_pathEval
3739
else {
3840
Write-Verbose 'Metadata file found. Performing metadata comparison...'
@@ -47,8 +49,10 @@ function Confirm-MetadataUpdate {
4749

4850
$tempMetadataFile = '{0}_temp' -f $script:metadataFile
4951
$tempMetadataFilePath = [System.IO.Path]::Combine($script:dataPath, $tempMetadataFile)
52+
Write-Debug -Message ('Temp metadata file path: {0}' -f $tempMetadataFilePath)
5053
# if the temp metadata file exists, delete it
5154
if (Test-Path -Path $tempMetadataFile) {
55+
Write-Debug -Message 'Removing temp metadata file...'
5256
Remove-Item -Path $tempMetadataFilePath -Force
5357
}
5458

@@ -60,6 +64,7 @@ function Confirm-MetadataUpdate {
6064
return $result
6165
}
6266

67+
Write-Debug -Message 'Getting content of temp metadata file...'
6368
try {
6469
$remoteMetadata = Get-Content $tempMetadataFilePath -ErrorAction 'Stop' | ConvertFrom-Json
6570
}
@@ -69,6 +74,9 @@ function Confirm-MetadataUpdate {
6974
return $result
7075
}
7176

77+
Write-Debug -Message ('Local metadata version: {0}' -f $localMetadata.version)
78+
Write-Debug -Message ('Remote metadata version: {0}' -f $remoteMetadata.version)
79+
7280
Write-Verbose -Message ('{0} vs {1}' -f $localMetadata.version, $remoteMetadata.version)
7381
if ($localMetadata.version -eq $remoteMetadata.version) {
7482
Write-Verbose 'Metadata file is current.'

src/pwshEmojiExplorer/Private/Confirm-XMLDataSet.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function Confirm-XMLDataSet {
2828

2929
# if the file doesn't exist, we need to download it
3030
Write-Verbose -Message 'Checking for data file...'
31+
Write-Debug -Message ('Data file path: {0}' -f $dataFile)
3132
try {
3233
$pathEval = Test-Path -Path $dataFile -ErrorAction Stop
3334
}
@@ -38,6 +39,7 @@ function Confirm-XMLDataSet {
3839
}
3940

4041
if (-not ($pathEval)) {
42+
Write-Debug -Message 'Data file not found.'
4143
$result = $false
4244
} #if_pathEval
4345
else {

src/pwshEmojiExplorer/Private/Convert-EmojiToHexCodePoint.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function Convert-EmojiToHexCodePoint {
2424
[string]$Emoji
2525
)
2626

27+
Write-Debug -Message 'Converting emoji to hexadecimal code points...'
2728
$charArray = $Emoji.ToCharArray()
2829
$codePoints = New-Object System.Collections.Generic.List[string]
2930

src/pwshEmojiExplorer/Private/ConvertTo-PSEmoji.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ function ConvertTo-PSEmoji {
4545
[PSCustomObject]$CustomObject
4646
)
4747

48+
Write-Debug -Message 'Converting custom object to PSEmoji object...'
49+
4850
$emoji = [PSEmoji]::new(
4951
$CustomObject.Group,
5052
$CustomObject.Subgroup,

src/pwshEmojiExplorer/Private/Expand-XMLDataSet.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function Expand-XMLDataSet {
2222
$dataFile = '{0}/{1}' -f $script:dataPath, $script:dataFile
2323

2424
Write-Verbose -Message 'Testing if data set file already exists...'
25+
Write-Debug -Message ('Data file path: {0}' -f $dataFile)
2526
try {
2627
$pathEval = Test-Path -Path $dataFile -ErrorAction Stop
2728
Write-Verbose -Message "EVAL: $true"

src/pwshEmojiExplorer/Private/Get-RemoteFile.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ function Get-RemoteFile {
4040
}
4141

4242
Write-Verbose -Message 'Downloading file...'
43+
$outFilePath = [System.IO.Path]::Combine($script:dataPath, $OutFile)
44+
Write-Debug -Message ('Out file path: {0}' -f $outFilePath)
4345
try {
4446
$invokeWebRequestSplat = @{
45-
OutFile = [System.IO.Path]::Combine($script:dataPath, $OutFile)
47+
OutFile = $outFilePath
4648
Uri = 'https://{0}/{1}' -f $script:dlURI, $File
4749
ErrorAction = 'Stop'
4850
}

src/pwshEmojiExplorer/Private/Import-XMLDataSet.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function Import-XMLDataSet {
2424
if ($null -eq $script:glData) {
2525
$dataCheck = Invoke-XMLDataCheck
2626
if ($dataCheck) {
27+
Write-Debug -Message 'XMLDataCheck returned true.'
2728
try {
2829
$getContentSplat = @{
2930
Path = "$script:dataPath\$script:dataFile"
@@ -39,6 +40,7 @@ function Import-XMLDataSet {
3940
} #catch
4041
} #if_dataCheck
4142
else {
43+
Write-Debug -Message 'XMLDataCheck returned false.'
4244
$result = $false
4345
} #else_dataCheck
4446
} #if_gldata

0 commit comments

Comments
 (0)