Skip to content

Commit 2cfad32

Browse files
committed
fix windows
1 parent ae3a474 commit 2cfad32

2 files changed

Lines changed: 5 additions & 39 deletions

File tree

.github/workflows/it-test.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ jobs:
6868
if: matrix.os != 'windows-latest'
6969
run: chmod +x cli-v2
7070

71-
- name: Install yq on Windows
72-
if: matrix.os == 'windows-latest'
73-
shell: pwsh
74-
run: |
75-
choco install yq -y
76-
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
77-
refreshenv
78-
7971
- name: Run init tests on Windows
8072
if: matrix.os == 'windows-latest'
8173
id: run_init_tests_windows

integration-tests/run.ps1

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,11 @@ function Normalize-Config {
2121

2222
switch ($ext) {
2323
{ $_ -in @('yaml', 'yml') } {
24-
# For YAML files, preserve the structure and sort within each section
25-
$content = Get-Content $file -Raw
26-
27-
# Extract sections using regex
28-
$runtimesMatch = [regex]::Match($content, "runtimes:([\s\S]*?)tools:")
29-
$toolsMatch = [regex]::Match($content, "tools:([\s\S]*?)$")
30-
31-
if ($runtimesMatch.Success -and $toolsMatch.Success) {
32-
# Extract and sort runtimes
33-
$runtimes = $runtimesMatch.Groups[1].Value -split "`n" |
34-
Where-Object { $_ -match "^\s*-\s*" } |
35-
Sort-Object |
36-
ForEach-Object { $_.Trim() }
37-
38-
# Extract and sort tools
39-
$tools = $toolsMatch.Groups[1].Value -split "`n" |
40-
Where-Object { $_ -match "^\s*-\s*" } |
41-
Sort-Object |
42-
ForEach-Object { $_.Trim() }
43-
44-
# Return normalized content
45-
@(
46-
"runtimes:"
47-
$runtimes | ForEach-Object { " $_" }
48-
"tools:"
49-
$tools | ForEach-Object { " $_" }
50-
)
51-
} else {
52-
Write-Error "Failed to parse YAML structure in $file"
53-
exit 1
54-
}
24+
# For YAML files, just sort the lines
25+
Get-Content $file |
26+
Where-Object { $_ -match '\S' } | # Skip empty lines
27+
Sort-Object |
28+
ForEach-Object { $_.Trim() }
5529
}
5630
{ $_ -in @('rc', 'conf', 'ini', 'xml') } {
5731
Get-Content $file | ForEach-Object {

0 commit comments

Comments
 (0)