Repository navigation
fix(airc.ps1): resolve bash 'airc' via AIRC_DIR (Windows clean-install fix) - #268
Merged
Merged
Conversation
PR #262 made airc.ps1 a thin Git Bash forwarder that locates the bash `airc` next to itself. install.ps1 copies airc.ps1 to $BIN_TARGET (on PATH) but the bash `airc` + `lib/` tree stays in $CLONE_DIR — they're NOT siblings on Windows. Linux/Mac sidesteps this with a symlink at $BIN_DIR/airc; Windows can't symlink reliably so it copies, which broke the sibling resolution. After install: $BIN_TARGET\airc.ps1 ← copied $BIN_TARGET\airc.cmd ← copied $CLONE_DIR\airc ← bash entry point (lives with its lib/) $CLONE_DIR\lib\airc_bash ← sourced by bash airc Symptom (clean-install-windows CI): airc.ps1: cannot find sibling 'airc' bash script at C:\Users\runneradmin\AppData\Local\Programs\airc\airc. Reinstall via install.ps1. Fix: resolve via $env:AIRC_DIR (matching bash convention), default $HOME\.airc-src. Keep sibling lookup as a dev-checkout fallback so running airc.ps1 directly from a git checkout still works. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Updates the Windows PowerShell entrypoint (airc.ps1) to reliably locate the bash airc script when airc.ps1 is installed into a PATH directory that is not a sibling of the repo checkout (the Windows clean-install layout).
Changes:
- Adds resolution of the bash
aircscript via$env:AIRC_DIR(fallbacking to$env:USERPROFILE\.airc-src) instead of assuming sibling layout. - Keeps a “dev checkout” fallback that prefers a sibling
aircwhen present. - Improves inline comments and the missing-script error message to reflect the Windows install model.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # | ||
| # Fallback: if airc.ps1 is invoked directly from a source checkout (rare, | ||
| # usually devs), prefer a sibling `airc` script — that's the dev workflow. | ||
| $psDir = Split-Path -Parent $MyInvocation.MyCommand.Path |
| # git checkout). Linux/Mac sidesteps this with a symlink at $BIN_DIR/airc; | ||
| # Windows can't symlink reliably, so we resolve via env var instead. The | ||
| # convention matches the bash side: $env:AIRC_DIR overrides, default is | ||
| # $HOME\.airc-src. |
| $aircDir = if ($env:AIRC_DIR) { $env:AIRC_DIR } else { Join-Path $env:USERPROFILE '.airc-src' } | ||
| $bashAirc = Join-Path $aircDir 'airc' | ||
| if (-not (Test-Path -LiteralPath $bashAirc)) { | ||
| Write-Error "airc.ps1: cannot find bash 'airc' script at $bashAirc (set `$env:AIRC_DIR or reinstall via install.ps1)." |
This was referenced Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aircnext to itself$BIN_TARGET(on PATH) but the bashairc+lib/tree stays in$CLONE_DIR— they're NOT siblings on Windows$BIN_DIR/airc; Windows can't symlink reliably so it copies, which broke sibling resolution$env:AIRC_DIR(matching bash convention), default$HOME\.airc-src. Keep sibling lookup as a dev-checkout fallbackSymptom (PR #267 clean-install-windows CI)
Test plan
pwsh ./airc.ps1from source checkout still works (sibling fallback)🤖 Generated with Claude Code