diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d9972765..ebd0b5e07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Fixed +- `squad init` no longer runs `git init` automatically when initialized inside a monorepo subdirectory (#939). It now shows a warning and suggests running from the git root instead. +- Azure DevOps adapter (`az` CLI calls) now use `shell: true` on Windows so `.cmd` wrapper scripts resolve correctly (#941). - **Nap archival budget** (#123) — account for separator newlines in decision archival budget calculation ### Added — Full Work Monitor for squad watch (#708) @@ -316,3 +318,4 @@ All notable changes to this project will be documented in this file. - Changesets infrastructure for independent package versioning + diff --git a/packages/squad-cli/src/cli/core/init.ts b/packages/squad-cli/src/cli/core/init.ts index 8c73e0ae5..592de5aef 100644 --- a/packages/squad-cli/src/cli/core/init.ts +++ b/packages/squad-cli/src/cli/core/init.ts @@ -141,11 +141,7 @@ export async function runInit(dest: string, options: RunInitOptions = {}): Promi console.log(); console.log(`${DIM}Copilot resolves .github/agents/ from the git root, not from here.${RESET}`); console.log(`${DIM}The Squad agent won't be visible to copilot in this folder.${RESET}`); - console.log(); - // Auto-fix: run git init to create a repo boundary here - console.log(`${CYAN}${BOLD}→${RESET} Running ${CYAN}git init${RESET} to create a repo boundary...`); - execFileSync('git', ['init'], { cwd: dest, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }); - console.log(`${GREEN}${BOLD}✓${RESET} Initialized git repo at ${normalDest}`); + console.log(`${DIM}Consider running squad init from the git root instead.${RESET}`); console.log(); } } catch { diff --git a/packages/squad-sdk/src/platform/azure-devops.ts b/packages/squad-sdk/src/platform/azure-devops.ts index 7264f2121..279628b0e 100644 --- a/packages/squad-sdk/src/platform/azure-devops.ts +++ b/packages/squad-sdk/src/platform/azure-devops.ts @@ -4,10 +4,12 @@ * @module platform/azure-devops */ -import { execFileSync, execSync } from 'node:child_process'; +import { execFileSync } from 'node:child_process'; import type { PlatformAdapter, PlatformType, WorkItem, PullRequest } from './types.js'; +const IS_WINDOWS = process.platform === 'win32'; const EXEC_OPTS: { encoding: 'utf-8'; stdio: ['pipe', 'pipe', 'pipe'] } = { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }; +const AZ_OPTS = { ...EXEC_OPTS, shell: IS_WINDOWS }; /** Descriptor for a work item type returned by process template introspection. */ export interface WorkItemTypeInfo { @@ -22,7 +24,7 @@ export interface WorkItemTypeInfo { /** Check whether the az CLI with devops extension is available */ function assertAzCliAvailable(): void { try { - execSync('az devops -h', EXEC_OPTS); + execFileSync('az', ['devops', '-h'], AZ_OPTS); } catch { throw new Error( 'Azure DevOps CLI not found. Install it with:\n' + @@ -67,7 +69,7 @@ export function getAvailableWorkItemTypes(org: string, project: string): WorkIte '--org', orgUrl, '--project', project, '--output', 'json', - ], { ...EXEC_OPTS, timeout: 3_000 }).trim(); + ], { ...AZ_OPTS, timeout: 3_000 }).trim(); const types = parseJson { @@ -433,7 +435,7 @@ export class AzureDevOpsAdapter implements PlatformAdapter { try { const orgUrl = `https://dev.azure.com/${targetOrg}`; - execFileSync('az', ['devops', 'configure', '--defaults', `organization=${orgUrl}`], EXEC_OPTS); + execFileSync('az', ['devops', 'configure', '--defaults', `organization=${orgUrl}`], AZ_OPTS); } catch { // az CLI might not be installed — non-fatal }