Skip to content

fix: squad init no longer runs git init in subdirectory; az CLI Windows shell fix - #946

Merged
bradygaster merged 1 commit into
github:devfrom
karlismea:squad/939-941-init-git-init-ado-windows
Apr 12, 2026
Merged

bradygaster merged 1 commit into
github:devfrom
karlismea:squad/939-941-init-git-init-ado-windows

Conversation

@karlismea

Copy link
Copy Markdown
Contributor

What

Two targeted bug fixes:

  1. squad init: Squad init should not run git init in a sub-folder of a repository (or ever) #939 — squad init no longer runs git init in monorepo subdirectories
    When squad init detected CWD was inside a parent git repo (e.g. a monorepo subfolder), it would automatically run git init to create a nested repo boundary. This caused unexpected nested git repos. Now it just warns and advises the user to run from the git root.

  2. fix(sdk): Add shell: IS_WINDOWS to ADO adapter execFileSync calls #941 — Azure DevOps adapter uses shell: true on Windows for az CLI calls
    On Windows, az is a .cmd wrapper script. execFileSync('az', ...) without shell: true fails to resolve it. Added IS_WINDOWS = process.platform === 'win32' constant and AZ_OPTS = {...EXEC_OPTS, shell: IS_WINDOWS} applied to all az exec calls. Also converted assertAzCliAvailable from execSync to execFileSync for consistency.

Why

How

  • init.ts: Remove the auto-fix git init block; replace with a clear message pointing to the git root
  • azure-devops.ts: Add IS_WINDOWS + AZ_OPTS constants; apply to all 4 az exec calls

Testing

  • Build passes: npm run build
  • Tests pass: npx vitest run (pre-existing failures in docs-build and cli-packaging-smoke unrelated)

Closes #939
Closes #941

…ws shell fix

- squad init: remove automatic git init when CWD is inside a parent git repo
  (monorepo case). Now shows a warning and advises running from the git root.
  Closes github#939

- Azure DevOps adapter: use shell: IS_WINDOWS for all execFileSync('az', ...)
  calls so the .cmd wrapper script resolves correctly on Windows. Also convert
  assertAzCliAvailable from execSync to execFileSync for consistency.
  Closes github#941

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 9, 2026 15:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes two platform-specific bugs in Squad’s CLI init flow and Azure DevOps SDK adapter to avoid unintended git repo nesting in monorepos and restore Windows compatibility for az CLI execution.

Changes:

  • Removed the squad init behavior that ran git init when executed in a subdirectory of an existing parent repo; now it only warns/suggests running from the git root.
  • Updated Azure DevOps adapter az CLI invocations to use shell: true on Windows (via shell: IS_WINDOWS) and switched the CLI-availability check to execFileSync.
  • Documented both fixes in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/squad-sdk/src/platform/azure-devops.ts Adds Windows-aware exec options for az calls and replaces execSync with execFileSync for the availability check.
packages/squad-cli/src/cli/core/init.ts Stops auto-running git init in subdirectories; replaces it with guidance to run init from the git root.
CHANGELOG.md Notes both bug fixes under Unreleased → Fixed.

@bradygaster
bradygaster merged commit e49d9c9 into github:dev Apr 12, 2026
3 of 4 checks passed
karlis-balcers pushed a commit to karlis-balcers/squad that referenced this pull request Apr 13, 2026
…#941 (PR github#946)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
karlis-balcers pushed a commit to karlis-balcers/squad that referenced this pull request Apr 13, 2026
…#941 (PR github#946)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher pushed a commit that referenced this pull request Apr 21, 2026
…ws shell fix (#946)

- squad init: remove automatic git init when CWD is inside a parent git repo
  (monorepo case). Now shows a warning and advises running from the git root.
  Closes #939

- Azure DevOps adapter: use shell: IS_WINDOWS for all execFileSync('az', ...)
  calls so the .cmd wrapper script resolves correctly on Windows. Also convert
  assertAzCliAvailable from execSync to execFileSync for consistency.
  Closes #941

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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

3 participants