3 Commits
1.5.1 ... 1.5.3

Author SHA1 Message Date
b6a46b38bd Revert module version to 1.5.3 in the module manifest
All checks were successful
Publish Powershell Module to Gitea Repository / test (push) Successful in 10s
Publish Powershell Module to Gitea Repository / deploy (push) Successful in 33s
2025-05-27 14:23:10 -04:00
3f66adb4ca Bump module version to 1.5.5 and update Invoke-GiteaFileDownload to ensure URL encoded characters in the file name are properly replaced. 2025-05-27 14:22:51 -04:00
d647600568 Update Get-GiteaFileContent tests to use 'Result' for status reporting instead of 'Success'
All checks were successful
Publish Powershell Module to Gitea Repository / test (push) Successful in 10s
Publish Powershell Module to Gitea Repository / deploy (push) Successful in 32s
2025-05-27 13:27:38 -04:00
3 changed files with 8 additions and 7 deletions

View File

@@ -12,7 +12,7 @@
RootModule = 'PS-GiteaUtilities.psm1'
# Version number of this module.
ModuleVersion = '1.5.0'
ModuleVersion = '1.5.3'
# Supported PSEditions
# CompatiblePSEditions = @()

View File

@@ -472,10 +472,11 @@ Function Invoke-GiteaFileDownload {
$branchIndex = [Array]::IndexOf($pathSegments, "branch") + 2
$DownloadFilePath = $pathSegments[$branchIndex..($pathSegments.Length - 2)] -join '/'
# Replace any URL encoded characters in the file name
$DownloadFilePath = [System.Uri]::UnescapeDataString($DownloadFilePath)
$DownloadFileName = $pathSegments[-1]
}
$DownloadFilePath = [System.Uri]::UnescapeDataString($DownloadFilePath)
if ($PreserveRelativePath -and $outputPath) {
# If PreserveRelativePath is used, set up the directory structure
Write-Verbose "Preserving relative path structure for: $DownloadFileName"

View File

@@ -21,7 +21,7 @@ Describe 'Get-GiteaFileContent' {
$result = Get-GiteaFileContent -repoOwner 'user' -repoName 'repo' -filePath 'README.md' -token 'abc123'
$result | Should -Not -BeNullOrEmpty
$result.Success | Should -Be $true
$result.Result | Should -Be 'Success'
$result.Content | Should -Be ([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes('Hello World')))
}
@@ -29,7 +29,7 @@ Describe 'Get-GiteaFileContent' {
$result = Get-GiteaFileContent -repoOwner 'user' -repoName 'repo' -filePath 'README.md' -token 'abc123' -decode
$result | Should -Not -BeNullOrEmpty
$result.Success | Should -Be $true
$result.Result | Should -Be 'Success'
$result.Content | Should -Be 'Hello World'
}
}
@@ -73,7 +73,7 @@ Describe 'Get-GiteaFileContent' {
It 'Should capture error and mark result as unsuccessful' {
$result = Get-GiteaFileContent -repoOwner 'user' -repoName 'repo' -filePath 'badfile.ps1' -token 'abc123'
$result.Success | Should -Be $false
$result.Result | Should -Be 'Failure'
$result.Error | Should -Match 'API call failed'
}
}
@@ -103,7 +103,7 @@ Describe 'Get-GiteaFileContent' {
$result = Get-GiteaFileContent -repoOwner 'user' -repoName 'repo' -filePath 'testfile.txt' -token 'abc123'
$result | Should -Not -BeNullOrEmpty
$result.Success | Should -Be $true
$result.Result | Should -Be 'Success'
$result.Content | Should -Be ([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes('Hello from API!')))
}
@@ -111,7 +111,7 @@ Describe 'Get-GiteaFileContent' {
$result = Get-GiteaFileContent -repoOwner 'user' -repoName 'repo' -filePath 'testfile.txt' -token 'abc123' -decode
$result | Should -Not -BeNullOrEmpty
$result.Success | Should -Be $true
$result.Result | Should -Be 'Success'
$result.Content | Should -Be 'Hello from API!'
}
}