export class UserDataFolder { public getPathHome ( ) { let path ; if ( process . platform === "win32" ) { path = process . env . APPDATA || "" ; return path ; } else if ( process . platform === "darwin" || process . platform === "linux" ) { path = process . env . HOME || "" ; return path ; } else { console . error ( "Error: Platform not detected; only windows, mac and linux supported" ) ; return "" ; } } public getPathCodeSettings ( ) { const homePath = this . getPathHome ( ) ; let codeSettingsPath = homePath ; if ( process . platform === "win32" ) { if ( process . execPath . match ( /insiders/gi ) ) { codeSettingsPath += "\\Code - Insiders\\User\\" ; } else { codeSettingsPath += "\\Code\\User\\" ; } return codeSettingsPath ; } else if ( process . platform === "darwin" || process . platform === "linux" ) { if ( process . platform === "darwin" ) { codeSettingsPath += "/Library/Application Support" ; } else if ( process . platform === "linux" ) { codeSettingsPath += "/.config" ; } if ( process . execPath . match ( /insiders/gi ) ) { codeSettingsPath += "/Code - Insiders/User/" ; } else { codeSettingsPath += "/Code/User/" ; } return codeSettingsPath ; } else { console . error ( "Error: Platform not detected; only windows, mac and linux supported." ) ; return "" ; } } }