Detect bun/node runtime version by basename, not exact command file
detectDirectRuntimeVersion switched on command.file === 'bun'|'node', so a resolved absolute path (e.g. /home/claude/.bun/bin/bun) fell through to "host:<path>" and lost the version. Match on path.basename so the version probe fires and runtimeVersion stays "host:bun@<ver>" regardless of how the package-manager command was resolved. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -151,10 +151,14 @@ function readPackageScripts(repoDir: string): Record<string, string> {
|
|||||||
function detectDirectRuntimeVersion(
|
function detectDirectRuntimeVersion(
|
||||||
command: Pick<VerificationCommandSpec, 'file'>,
|
command: Pick<VerificationCommandSpec, 'file'>,
|
||||||
): string {
|
): string {
|
||||||
|
// The command file may be a bare name ("bun") or a resolved absolute path
|
||||||
|
// ("/home/claude/.bun/bin/bun"); match on the basename so version detection
|
||||||
|
// still fires instead of degrading to "host:<path>".
|
||||||
|
const runtimeName = path.basename(command.file);
|
||||||
try {
|
try {
|
||||||
switch (command.file) {
|
switch (runtimeName) {
|
||||||
case 'bun': {
|
case 'bun': {
|
||||||
const bunVersion = execFileSync('bun', ['--version'], {
|
const bunVersion = execFileSync(command.file, ['--version'], {
|
||||||
encoding: 'utf-8',
|
encoding: 'utf-8',
|
||||||
stdio: ['ignore', 'pipe', 'pipe'],
|
stdio: ['ignore', 'pipe', 'pipe'],
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
|
|||||||
Reference in New Issue
Block a user