Skip to content

Commit 6854495

Browse files
committed
Fix Windows CI: ensure Emacs is on PATH after Chocolatey install
The `choco install emacs` command installs Emacs but subsequent CI steps couldn't find it because the PATH wasn't updated. Now we locate the installed emacs.exe, add its directory to the machine-level PATH (so all steps see it), and verify with `emacs --version`.
1 parent 4bccd24 commit 6854495

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ jobs:
111111
name: Install Emacs latest
112112
command: |
113113
choco install emacs -y
114+
# Ensure Emacs is on the machine PATH for subsequent steps
115+
$emacsDir = (Get-ChildItem "C:\ProgramData\chocolatey\lib\Emacs*" -Recurse -Filter "emacs.exe" -ErrorAction SilentlyContinue | Select-Object -First 1).DirectoryName
116+
if ($emacsDir) {
117+
$machinePath = [Environment]::GetEnvironmentVariable("PATH", "Machine")
118+
if ($machinePath -notlike "*$emacsDir*") {
119+
[Environment]::SetEnvironmentVariable("PATH", "$emacsDir;$machinePath", "Machine")
120+
}
121+
}
122+
# Refresh current session PATH and verify
123+
$env:Path = [Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [Environment]::GetEnvironmentVariable("PATH", "User")
124+
emacs --version
114125
- setup-windows
115126
- test
116127
- lint

0 commit comments

Comments
 (0)