3 Commits
1.3.0 ... 1.3.1

Author SHA1 Message Date
dd47a1b7e2 Bump module version to 1.3.1 in the module manifest.
All checks were successful
Publish Powershell Module to Gitea Repository / test (push) Successful in 9s
Publish Powershell Module to Gitea Repository / deploy (push) Successful in 32s
2025-04-30 15:23:44 -04:00
c65cde9fbc Refactor path handling for cross-platform compatibility and update configuration directory path 2025-04-30 15:20:52 -04:00
c18f68bc46 Remove unnecessary blank line in Pester test execution step 2025-04-30 15:05:05 -04:00
3 changed files with 9 additions and 8 deletions

View File

@@ -20,7 +20,6 @@ jobs:
- name: Run pester tests and verify all tests pass - name: Run pester tests and verify all tests pass
shell: pwsh shell: pwsh
run: | run: |
Write-Host "Changing to repository directory: ${{ github.workspace }}" Write-Host "Changing to repository directory: ${{ github.workspace }}"
Set-Location -Path ${{ github.workspace }} Set-Location -Path ${{ github.workspace }}
Write-Host "Running Pester tests" Write-Host "Running Pester tests"

View File

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

View File

@@ -11,7 +11,7 @@ Function Set-GiteaConfiguration {
) )
# Create configuration directory if it doesn't exist # Create configuration directory if it doesn't exist
$configDir = Join-Path -Path $env:USERPROFILE -ChildPath ".giteautils" $configDir = Join-Path -Path $HOME -ChildPath ".giteautils"
if (-not (Test-Path -Path $configDir)) { if (-not (Test-Path -Path $configDir)) {
New-Item -Path $configDir -ItemType Directory | Out-Null New-Item -Path $configDir -ItemType Directory | Out-Null
} }
@@ -36,7 +36,7 @@ Function Get-GiteaConfiguration {
[switch]$Force [switch]$Force
) )
$configPath = Join-Path -Path $env:USERPROFILE -ChildPath ".giteautils\config.xml" $configPath = Join-Path -Path $HOME -ChildPath ".giteautils/config.xml"
if (Test-Path -Path $configPath) { if (Test-Path -Path $configPath) {
$config = Import-Clixml -Path $configPath $config = Import-Clixml -Path $configPath
@@ -180,6 +180,8 @@ Function Get-GiteaFileContent {
process { process {
foreach ($file in $filePath) { foreach ($file in $filePath) {
# Normalize path separators for cross-platform compatibility
$file = $file -replace '\\', '/'
Write-Verbose "Processing file: $file" Write-Verbose "Processing file: $file"
$encodedFile = [System.Uri]::EscapeDataString($file) $encodedFile = [System.Uri]::EscapeDataString($file)
Write-Verbose "Encoded file: $encodedFile" Write-Verbose "Encoded file: $encodedFile"
@@ -191,7 +193,6 @@ Function Get-GiteaFileContent {
$url += "/$encodedFile" $url += "/$encodedFile"
$url += "?ref=$branch" $url += "?ref=$branch"
Write-Verbose "URL: $url" Write-Verbose "URL: $url"
try { try {
$fileContent = Invoke-RestMethod -Uri $url -Method Get -Headers $headers $fileContent = Invoke-RestMethod -Uri $url -Method Get -Headers $headers
@@ -398,6 +399,8 @@ Function Invoke-GiteaFileDownload {
} }
process { process {
# Normalize path separators for cross-platform compatibility
$filePath = $filePath -replace '\\', '/'
Write-Verbose "File path: $filePath" Write-Verbose "File path: $filePath"
Write-Verbose "Type: $type" Write-Verbose "Type: $type"
@@ -664,11 +667,10 @@ Function Get-GiteaChildItem {
$paths = $path $paths = $path
foreach ($path in $paths) { foreach ($path in $paths) {
Write-Verbose "Processing path: $path" Write-Verbose "Processing path: $path"
# Normalize the path format - replace backslashes with forward slashes and trim trailing slashes # Normalize path separators for cross-platform compatibility
$normalizedPath = $path -replace '\\', '/' -replace '/$', '' $normalizedPath = $path -replace '\\', '/' -replace '/$', ''
$encodedPath = [System.Uri]::EscapeDataString($normalizedPath)
Write-Verbose "Normalized path: $normalizedPath" Write-Verbose "Normalized path: $normalizedPath"
Write-Verbose "Encoded path: $encodedPath" $encodedPath = [System.Uri]::EscapeDataString($normalizedPath)
$url = "$giteaURL" $url = "$giteaURL"
$url += "/api/v1/repos" $url += "/api/v1/repos"
$url += "/$repoOwner" $url += "/$repoOwner"