Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd47a1b7e2 | |||
| c65cde9fbc | |||
| c18f68bc46 |
@@ -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"
|
||||||
|
|||||||
@@ -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 = @()
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user