()
| 65 | } |
| 66 | |
| 67 | private static GetDarwinVersion(): Promise<string> { |
| 68 | const DARWIN_SYSTEM_VERSION_PLIST: string = "/System/Library/CoreServices/SystemVersion.plist"; |
| 69 | let productDarwinVersion: string = ""; |
| 70 | let errorMessage: string = ""; |
| 71 | |
| 72 | if (util.checkFileExistsSync(DARWIN_SYSTEM_VERSION_PLIST)) { |
| 73 | const systemVersionPListBuffer: Buffer = fs.readFileSync(DARWIN_SYSTEM_VERSION_PLIST); |
| 74 | const systemVersionData: any = plist.parse(systemVersionPListBuffer.toString()); |
| 75 | if (systemVersionData) { |
| 76 | productDarwinVersion = systemVersionData.ProductVersion; |
| 77 | } else { |
| 78 | errorMessage = localize("missing.plist.productversion", "Could not get ProduceVersion from SystemVersion.plist"); |
| 79 | } |
| 80 | } else { |
| 81 | errorMessage = localize("missing.darwin.systemversion.file", "Failed to find SystemVersion.plist in {0}.", DARWIN_SYSTEM_VERSION_PLIST); |
| 82 | } |
| 83 | |
| 84 | if (errorMessage) { |
| 85 | logger.getOutputChannel().appendLine(errorMessage); |
| 86 | logger.showOutputChannel(); |
| 87 | } |
| 88 | |
| 89 | return Promise.resolve(productDarwinVersion); |
| 90 | } |
| 91 | |
| 92 | private static GetWindowsVersion(): SupportedWindowsVersions { |
| 93 | const version = os.release().split('.'); |
no test coverage detected