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
shell: pwsh
run: |
Write-Host "Changing to repository directory: ${{ github.workspace }}"
Set-Location -Path ${{ github.workspace }}
Write-Host "Running Pester tests"

View File

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

View File

@@ -11,7 +11,7 @@ Function Set-GiteaConfiguration {
)
# 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)) {
New-Item -Path $configDir -ItemType Directory | Out-Null
}
@@ -36,7 +36,7 @@ Function Get-GiteaConfiguration {
[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) {
$config = Import-Clixml -Path $configPath
@@ -180,6 +180,8 @@ Function Get-GiteaFileContent {
process {
foreach ($file in $filePath) {
# Normalize path separators for cross-platform compatibility
$file = $file -replace '\\', '/'
Write-Verbose "Processing file: $file"
$encodedFile = [System.Uri]::EscapeDataString($file)
Write-Verbose "Encoded file: $encodedFile"
@@ -191,7 +193,6 @@ Function Get-GiteaFileContent {
$url += "/$encodedFile"
$url += "?ref=$branch"
Write-Verbose "URL: $url"
try {
$fileContent = Invoke-RestMethod -Uri $url -Method Get -Headers $headers
@@ -398,6 +399,8 @@ Function Invoke-GiteaFileDownload {
}
process {
# Normalize path separators for cross-platform compatibility
$filePath = $filePath -replace '\\', '/'
Write-Verbose "File path: $filePath"
Write-Verbose "Type: $type"
@@ -664,11 +667,10 @@ Function Get-GiteaChildItem {
$paths = $path
foreach ($path in $paths) {
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 '/$', ''
$encodedPath = [System.Uri]::EscapeDataString($normalizedPath)
Write-Verbose "Normalized path: $normalizedPath"
Write-Verbose "Encoded path: $encodedPath"
$encodedPath = [System.Uri]::EscapeDataString($normalizedPath)
$url = "$giteaURL"
$url += "/api/v1/repos"
$url += "/$repoOwner"