GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com

import { logForDebugging } from './debug.js' import { which } from './which.js' // Session cache to avoid repeated checks const binaryCache = new Map() /** * Check if a binary/command is installed and available on the system. * Uses 'which' on Unix systems (macOS, Linux, WSL) and 'where' on Windows. * * @param command - The command name to check (e.g., 'gopls', 'rust-analyzer') * @returns Promise - true if the command exists, false otherwise */ export async function isBinaryInstalled(command: string): Promise { // Edge case: empty or whitespace-only command if (!command || !command.trim()) { logForDebugging('[binaryCheck] Empty command provided, returning false') return false } // Trim the command to handle whitespace const trimmedCommand = command.trim() // Check cache first const cached = binaryCache.get(trimmedCommand) if (cached !== undefined) { logForDebugging( `[binaryCheck] Cache hit for '${trimmedCommand}': ${cached}`, ) return cached } let exists = false if (await which(trimmedCommand).catch(() => null)) { exists = true } // Cache the result binaryCache.set(trimmedCommand, exists) logForDebugging( `[binaryCheck] Binary '${trimmedCommand}' ${exists ? 'found' : 'not found'}`, ) return exists } /** * Clear the binary check cache (useful for testing) */ export function clearBinaryCache(): void { binaryCache.clear() }
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.