Files
DevRunbook release export cfd2804e27
Managed validation / full (push) Successful in 3m18s
Publish DevRunbook source
2026-09-03 04:09:17 +02:00

25 lines
574 B
JavaScript

import { spawnSync } from 'node:child_process'
const candidates =
process.platform === 'win32'
? [
['py', ['-3']],
['python3', []],
['python', []],
]
: [
['python3', []],
['python', []],
]
for (const [command, prefix] of candidates) {
const result = spawnSync(command, [...prefix, ...process.argv.slice(2)], {
stdio: 'inherit',
})
if (result.error?.code === 'ENOENT') continue
process.exit(result.status ?? 1)
}
console.error('Python 3 was not found. Install Python 3 and retry.')
process.exit(1)