Skip to content

fix(airc.ps1): resolve bash 'airc' via AIRC_DIR (Windows clean-install fix) - #268

Merged
joelteply merged 1 commit into
canaryfrom
fix/airc-ps1-resolve-via-aircdir
Apr 29, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/airc-ps1-resolve-via-aircdir

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • PR refactor(airc.ps1): thin Git Bash forwarder, eliminates Bash↔PS drift (closes #152) #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 sibling resolution
  • Fix: resolve via $env:AIRC_DIR (matching bash convention), default $HOME\.airc-src. Keep sibling lookup as a dev-checkout fallback

Symptom (PR #267 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.

Test plan

🤖 Generated with Claude Code

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]>
Copilot AI review requested due to automatic review settings April 29, 2026 00:58
@joelteply
joelteply merged commit 95d612a into canary Apr 29, 2026
8 checks passed
@joelteply
joelteply deleted the fix/airc-ps1-resolve-via-aircdir branch April 29, 2026 00:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 airc script via $env:AIRC_DIR (fallbacking to $env:USERPROFILE\.airc-src) instead of assuming sibling layout.
  • Keeps a “dev checkout” fallback that prefers a sibling airc when 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.

Comment thread airc.ps1
#
# 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
Comment thread airc.ps1
# 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.
Comment thread airc.ps1
$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)."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants