UNPKG

@reliverse/rse

Version:

@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power

22 lines (21 loc) 724 B
import fs from "@reliverse/relifso"; import os from "node:os"; import { homeDir } from "../../constants.js"; export function isVSCodeInstalled() { const platform = os.platform(); const commonVSCodeInstallPaths = { darwin: [ "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" ], linux: ["/usr/bin/code", "/snap/bin/code"], win32: [ `${homeDir}\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe`, "C:/Program Files/Microsoft VS Code/Code.exe", "C:/Program Files (x86)/Microsoft VS Code/Code.exe" ] }; const pathsToCheck = commonVSCodeInstallPaths[platform] ?? []; return pathsToCheck.some( (vsCodePath) => fs.pathExistsSync(vsCodePath) ); }