Skip to content

Cross-platform: fix Windows/Linux compatibility gaps #11

Description

@pauldatta

Problem

The scanner is functionally cross-platform (Node.js + path.join everywhere), but an audit identified two gaps that prevent full Windows support and one macOS-only scanner.

Gaps

1. process.env.HOMEos.homedir() (Windows)

Files: scanner.js:114-115, scanners.js:444, lib/dashboard/server.js:36

process.env.HOME is undefined on Windows. The fallback || '' means it scans from root instead of the user profile. Should use os.homedir() which works on all platforms.

2. scanJetBrains — macOS-only path

File: scanners.js:329-338

Hardcoded to ~/Library/Application Support/JetBrains/Air. Linux path would be ~/.config/JetBrains/Air or ~/.local/share/JetBrains/Air. Windows: %APPDATA%/JetBrains/Air.

Currently returns { found: false } on non-macOS — not a crash, but a missed detection.

3. whichCmd uses Unix which

File: tui.js:201

which does not exist on Windows. Equivalent is where. Only used for optional tool detection (glow, bat, etc.) — fallback works, but logs a silent error.

4. scanAdminPolicies — no Windows system path

File: scanners.js:657-660

Only checks macOS (/Library/...) and Linux (/etc/...) system policy dirs. No %PROGRAMDATA% equivalent for Windows.

Impact

  • Linux: Fully functional today. Only scanJetBrains misses detection.
  • Windows: Works but HOME resolution is broken, JetBrains and admin policies are missed, whichCmd silently fails.
  • macOS: Full support ✅

Suggested Fix

  1. Replace all process.env.HOME || '' with os.homedir()
  2. Add platform-aware paths to scanJetBrains and scanAdminPolicies
  3. Use process.platform === 'win32' ? 'where' : 'which' in whichCmd

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/scannerScanning logic, data collectionenhancementNew feature or requesttype/bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions