npm ≥7 suppresses lifecycle script output by default, so the clack banner/spinner was invisible during `npm install -g`. The user-facing onboarding experience already lives at first `gsd` launch (onboarding.ts), making the postinstall UI redundant dead code. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
615 B
JavaScript
23 lines
615 B
JavaScript
#!/usr/bin/env node
|
|
|
|
import { exec as execCb } from 'child_process'
|
|
import { dirname, resolve } from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
const cwd = resolve(__dirname, '..')
|
|
const shouldSkip =
|
|
process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD === '1' ||
|
|
process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD === 'true'
|
|
|
|
function run(cmd) {
|
|
return new Promise((resolve) => {
|
|
execCb(cmd, { cwd }, (error, stdout, stderr) => {
|
|
resolve({ ok: !error, stdout, stderr })
|
|
})
|
|
})
|
|
}
|
|
|
|
if (!shouldSkip) {
|
|
await run('npx playwright install chromium')
|
|
}
|