MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / getVcpkgRoot

Function getVcpkgRoot

Extension/src/common.ts:145–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143
144let vcpkgRoot: string | undefined;
145export function getVcpkgRoot(): string {
146 if (!vcpkgRoot && vcpkgRoot !== "") {
147 vcpkgRoot = "";
148 // Check for vcpkg instance.
149 if (checkFileExistsSync(getVcpkgPathDescriptorFile())) {
150 let vcpkgRootTemp: string = fs.readFileSync(getVcpkgPathDescriptorFile()).toString();
151 vcpkgRootTemp = vcpkgRootTemp.trim();
152 if (checkDirectoryExistsSync(vcpkgRootTemp)) {
153 vcpkgRoot = path.join(vcpkgRootTemp, "/installed").replace(/\\/g, "/");
154 }
155 }
156 }
157 return vcpkgRoot;
158}
159
160/**
161 * This is a fuzzy determination of whether a uri represents a header file.

Callers

nothing calls this directly

Calls 5

checkFileExistsSyncFunction · 0.85
checkDirectoryExistsSyncFunction · 0.85
toStringMethod · 0.80
trimMethod · 0.80

Tested by

no test coverage detected