Skip to content

fix(tide): detect git/composer cross-platform in ScaffoldCommand#2

Merged
Damianttje merged 2 commits into
mainfrom
fix/tide-windows-git-detection
Jun 2, 2026
Merged

fix(tide): detect git/composer cross-platform in ScaffoldCommand#2
Damianttje merged 2 commits into
mainfrom
fix/tide-windows-git-detection

Conversation

@Damianttje
Copy link
Copy Markdown
Member

Summary

\ ide new\ falsely reported \git is not installed or not on PATH.\ on Windows because the lookup used the Unix-only \command -v X 2>/dev/null\ shell snippet. cmd.exe has no \command\ builtin and treats /dev/null\ as a literal path, so the command returned empty even when git was on PATH.

Changes

  • Add \Wave\CLI\Command::findExecutable(string ): string\ that uses \where\ on Windows and \command -v\ elsewhere. Returns the trimmed first match, or empty string.
  • Update \ScaffoldCommand::run()\ to use the helper for both \git\ and \composer\ lookups.
  • New \ ests/Unit/FindExecutableTest.php\ covers the positive case, missing-binary case, and platform-locator case.
  • CHANGELOG entry under [Unreleased] / Fixed.

Verification (local, Windows + PHP 8.4.21)

  • \�endor/bin/phpunit tests/Unit/FindExecutableTest.php\ → 3/3 pass
  • \�endor/bin/phpstan analyse\ (full project) → no errors
  • \�endor/bin/php-cs-fixer fix --dry-run\ → no fixable violations

The previous \command -v X 2>/dev/null\ pattern is Unix-only; on
Windows, cmd.exe tries to run a literal \command\ binary and the
\/dev/null\ redirect produces 'The system cannot find the path
specified.', so \	ide new\ falsely reported git as missing.

Add a \Command::findExecutable()\ helper that uses \where\ on
Windows and \command -v\ elsewhere, then route ScaffoldCommand
through it. Covered by a new FindExecutableTest.
@Damianttje Damianttje merged commit 6d7db9d into main Jun 2, 2026
4 checks passed
@Damianttje Damianttje deleted the fix/tide-windows-git-detection branch June 2, 2026 12:16
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