microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/extension/appcenter/auth/profile/getProfileDir.ts
21lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | import * as os from "os"; |
| 5 | import * as path from "path"; |
| 6 | |
| 7 | export const profileDirName = ".vscode-react-native"; |
| 8 | export const profileFile = "VSCodeAppCenterProfile.json"; |
| 9 | |
| 10 | export function getProfileDir(): string { |
| 11 | const profileDir = path.join(getProfileDirParent(), profileDirName); |
| 12 | return profileDir; |
| 13 | } |
| 14 | |
| 15 | export function getProfileDirParent(): string { |
| 16 | if (os.platform() === "win32") { |
| 17 | return process.env.AppData; |
| 18 | } else { |
| 19 | return os.homedir(); |
| 20 | } |
| 21 | } |
| 22 | |