MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / GetDarwinVersion

Method GetDarwinVersion

Extension/src/platform.ts:67–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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('.');

Callers 1

Calls 3

toStringMethod · 0.80
appendLineMethod · 0.80
resolveMethod · 0.65

Tested by

no test coverage detected