Skip to content

Commit

Permalink
refresh environment by importing module first
Browse files Browse the repository at this point in the history
Signed-off-by: midays <[email protected]>
  • Loading branch information
midays committed Nov 25, 2024
1 parent 6c91e75 commit 7761d20
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/windows-nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,11 @@ jobs:
run: choco install nodejs -y
shell: powershell

- name: Add VSCode and Node.js Manually to PATH
- name: Import Chocolatey Profile and Refresh Environment
shell: powershell
run: |
$nodePath = 'C:\Program Files\nodejs'
if (-Not (Test-Path $nodePath)) {
Write-Error "Node.js installation path not found at: $nodePath"
exit 1
}
$env:PATH += ";$nodePath"
$vscodePath = 'C:\Program Files\Microsoft VS Code\bin'
if (-Not (Test-Path $vscodePath)) {
Write-Error "VSCode installation path not found at: $vscodePath"
exit 1
}
$env:PATH += ";$vscodePath"
# Set the updated PATH variable at Machine level
[System.Environment]::SetEnvironmentVariable('PATH', $env:PATH, [System.EnvironmentVariableTarget]::Machine)
echo $env:PATH
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
- name: Check Env PATH variable
shell: powershell
Expand Down

0 comments on commit 7761d20

Please sign in to comment.