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.HOME → os.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
- Replace all
process.env.HOME || '' with os.homedir()
- Add platform-aware paths to
scanJetBrains and scanAdminPolicies
- Use
process.platform === 'win32' ? 'where' : 'which' in whichCmd
Problem
The scanner is functionally cross-platform (Node.js +
path.joineverywhere), but an audit identified two gaps that prevent full Windows support and one macOS-only scanner.Gaps
1.
process.env.HOME→os.homedir()(Windows)Files:
scanner.js:114-115,scanners.js:444,lib/dashboard/server.js:36process.env.HOMEisundefinedon Windows. The fallback|| ''means it scans from root instead of the user profile. Should useos.homedir()which works on all platforms.2.
scanJetBrains— macOS-only pathFile:
scanners.js:329-338Hardcoded to
~/Library/Application Support/JetBrains/Air. Linux path would be~/.config/JetBrains/Airor~/.local/share/JetBrains/Air. Windows:%APPDATA%/JetBrains/Air.Currently returns
{ found: false }on non-macOS — not a crash, but a missed detection.3.
whichCmduses UnixwhichFile:
tui.js:201whichdoes not exist on Windows. Equivalent iswhere. Only used for optional tool detection (glow, bat, etc.) — fallback works, but logs a silent error.4.
scanAdminPolicies— no Windows system pathFile:
scanners.js:657-660Only checks macOS (
/Library/...) and Linux (/etc/...) system policy dirs. No%PROGRAMDATA%equivalent for Windows.Impact
scanJetBrainsmisses detection.HOMEresolution is broken, JetBrains and admin policies are missed,whichCmdsilently fails.Suggested Fix
process.env.HOME || ''withos.homedir()scanJetBrainsandscanAdminPoliciesprocess.platform === 'win32' ? 'where' : 'which'inwhichCmd