Skip to content

Commit 5f1b6b9

Browse files
authored
fix(ci): fix fnm and nvm-windows migration tests (#149)
1 parent f6d8e73 commit 5f1b6b9

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/integration-test-migrate-node-macos-fnm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ jobs:
5151
- name: "Migrate fnm Node.js to dtvem"
5252
run: |
5353
echo "=== Running migrate detection ==="
54-
echo -e "1\n0\nn\n" | ./dist/dtvem migrate node || true
54+
# Select "all" to migrate all detected versions (system + fnm)
55+
echo -e "all\n0\nn\n" | ./dist/dtvem migrate node || true
5556
echo ""
5657
echo "=== Verifying migration ==="
5758
./dist/dtvem list node

.github/workflows/integration-test-migrate-node-windows-nvm.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ jobs:
4141
shell: pwsh
4242
run: |
4343
choco install nvm -y
44-
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
44+
# Add nvm to GITHUB_PATH for subsequent steps
45+
$nvmHome = [System.Environment]::GetEnvironmentVariable("NVM_HOME", "Machine")
46+
if (-not $nvmHome) { $nvmHome = "C:\ProgramData\nvm" }
47+
$nvmSymlink = [System.Environment]::GetEnvironmentVariable("NVM_SYMLINK", "Machine")
48+
if (-not $nvmSymlink) { $nvmSymlink = "C:\Program Files\nodejs" }
49+
"$nvmHome" | Out-File -FilePath $env:GITHUB_PATH -Append
50+
"$nvmSymlink" | Out-File -FilePath $env:GITHUB_PATH -Append
4551
4652
- name: "Install Node.js 20.18.0 via nvm-windows"
4753
shell: pwsh
4854
run: |
49-
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
5055
nvm install 20.18.0
5156
nvm use 20.18.0
5257
Write-Host "nvm-windows Node.js version:"
@@ -56,7 +61,8 @@ jobs:
5661
shell: bash
5762
run: |
5863
echo "=== Running migrate detection ==="
59-
echo -e "1\n0\nn\n" | ./dist/dtvem.exe migrate node || true
64+
# Select "all" to migrate all detected versions (system + nvm)
65+
echo -e "all\n0\nn\n" | ./dist/dtvem.exe migrate node || true
6066
echo ""
6167
echo "=== Verifying migration ==="
6268
./dist/dtvem.exe list node

0 commit comments

Comments
 (0)