Skip to content

fix: correct WSL2 OS detection by removing PWD-based Windows override#8869

Open
JheisonMB wants to merge 1 commit intoaaif-goose:mainfrom
JheisonMB:fix/wsl2_download_script
Open

fix: correct WSL2 OS detection by removing PWD-based Windows override#8869
JheisonMB wants to merge 1 commit intoaaif-goose:mainfrom
JheisonMB:fix/wsl2_download_script

Conversation

@JheisonMB
Copy link
Copy Markdown

Summary

Fixes a bug in download_cli.sh where WSL2 was incorrectly detected as Windows when executed from a Windows-mounted directory (e.g., /mnt/c/...).
The script previously used $PWD to decide whether to install the Windows or Linux build of goose. In WSL2, uname -s correctly reports "Linux", but the script was overriding this based on the current working directory path. This caused:

  • Download of goose-x86_64-pc-windows-msvc.zip instead of the Linux binary
  • Installation of a .exe file into a Linux binary path ($HOME/.local/bin/)
  • Attempts to use Windows-specific configuration paths (AppData\Roaming)

Testing

  • Verified bash -n download_cli.sh passes syntax check
  • Manual review of all OS detection branches:
    • Native Windows (WINDIR, msys, cygwin): still detects as windows
    • WSL (from /mnt/c/... or Linux paths): now correctly detects as linux

Related Issues

Relates to #8672

Screenshots/Demos (for UX changes)

After:
image

image

Signed-off-by: Jheison Martinez Bolivar <jheison.mb@gmail.com>
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.

1 participant