@@ -17,6 +17,7 @@ import { fatal } from '../core/errors.js';
1717import { detectSquadDir } from '../core/detect-squad-dir.js' ;
1818import { ghAvailable } from '../core/gh-cli.js' ;
1919
20+ const IS_WINDOWS = process . platform === 'win32' ;
2021const execFileAsync = promisify ( execFile ) ;
2122
2223// ── Types ─────────────────────────────────────────────────────────────────────
@@ -262,7 +263,7 @@ async function install(dest: string, source: string): Promise<void> {
262263 const repo = parts [ 1 ] ! ;
263264 const skillFilter = parts . length >= 3 ? parts . slice ( 2 ) . join ( '/' ) : undefined ;
264265
265- if ( ! ghAvailable ( ) ) {
266+ if ( ! ( await ghAvailable ( ) ) ) {
266267 fatal ( 'GitHub CLI (gh) is required for APM install. Install from https://cli.github.com/' ) ;
267268 }
268269
@@ -316,7 +317,7 @@ async function installFromGitHub(
316317 'api' ,
317318 `repos/${ owner } /${ repo } /contents/apm.yml` ,
318319 '--jq' , '.content' ,
319- ] ) ;
320+ ] , { shell : IS_WINDOWS } ) ;
320321 apmContent = Buffer . from ( stdout . trim ( ) , 'base64' ) . toString ( 'utf8' ) ;
321322 } catch {
322323 // No apm.yml — fall back to scanning skills directories
@@ -378,7 +379,7 @@ async function installFromGitHub(
378379 'api' ,
379380 `repos/${ owner } /${ repo } /contents/${ skill . path } ` ,
380381 '--jq' , '.content' ,
381- ] ) ;
382+ ] , { shell : IS_WINDOWS } ) ;
382383 const content = Buffer . from ( rawContent . trim ( ) , 'base64' ) . toString ( 'utf8' ) ;
383384 const skillDir = join ( skillsDir , skill . name ) ;
384385 await mkdir ( skillDir , { recursive : true } ) ;
@@ -421,7 +422,7 @@ async function installSkillsFromSquadDir(
421422 'api' ,
422423 `repos/${ owner } /${ repo } /contents/${ candidate } ` ,
423424 '--jq' , '[.[] | {name: .name, path: .path, type: .type}]' ,
424- ] ) ;
425+ ] , { shell : IS_WINDOWS } ) ;
425426 entries = JSON . parse ( stdout ) ;
426427 break ;
427428 } catch {
@@ -453,7 +454,7 @@ async function installSkillsFromSquadDir(
453454 'api' ,
454455 `repos/${ owner } /${ repo } /contents/${ skillFilePath } ` ,
455456 '--jq' , '.content' ,
456- ] ) ;
457+ ] , { shell : IS_WINDOWS } ) ;
457458 const content = Buffer . from ( rawContent . trim ( ) , 'base64' ) . toString ( 'utf8' ) ;
458459 const skillDir = join ( skillsDir , dir . name ) ;
459460 await mkdir ( skillDir , { recursive : true } ) ;
0 commit comments