vscpath
unknown
typescript
8 months ago
754 B
4
Indexable
import * as os from 'os'; import * as path from 'path'; function getVSCodeConfigPath(): string { const homeDir = os.homedir(); let configPath: string; switch (os.platform()) { case 'win32': configPath = path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'settings.json'); break; case 'darwin': configPath = path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'settings.json'); break; case 'linux': configPath = path.join(homeDir, '.config', 'Code', 'User', 'settings.json'); break; default: throw new Error('Unsupported platform!'); } return configPath; } console.log(getVSCodeConfigPath());
Editor is loading...
Leave a Comment