Skip to content

Commit

Permalink
check if the directory exists (#7487)
Browse files Browse the repository at this point in the history
  • Loading branch information
elahehrashedi authored May 10, 2021
1 parent 2e00bb9 commit 6ae687f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Extension/src/LanguageServer/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ export class CppProperties {
return;
} else {
try {
if (!await util.checkFileExists(this.configFolder)) {
if (!await util.checkDirectoryExists(this.configFolder)) {
fs.mkdirSync(this.configFolder);
}

Expand Down
4 changes: 2 additions & 2 deletions Extension/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
const arch: string = PlatformInformation.GetArchitecture();
if (arch !== 'x64' && (process.platform !== 'win32' || (arch !== 'x86' && arch !== 'arm64')) && (process.platform !== 'linux' || (arch !== 'x64' && arch !== 'arm' && arch !== 'arm64')) && (process.platform !== 'darwin' || arch !== 'arm64')) {
errMsg = localize("architecture.not.supported", "Architecture {0} is not supported. ", String(arch));
} else if (process.platform === 'linux' && await util.checkFileExists('/etc/alpine-release')) {
} else if (process.platform === 'linux' && await util.checkDirectoryExists('/etc/alpine-release')) {
errMsg = localize("apline.containers.not.supported", "Alpine containers are not supported.");
}
if (errMsg) {
Expand Down Expand Up @@ -162,7 +162,7 @@ async function processRuntimeDependencies(): Promise<void> {
// For macOS and if a user has upgraded their OS, check to see if we are on Mojave or later
// and that the debugAdapters/lldb-mi folder exists. This will force a online install to get the correct binaries.
if (!highSierraOrLowerRegex.test(info.version) &&
!await util.checkFileExists(lldbMiFolderPath)) {
!await util.checkDirectoryExists(lldbMiFolderPath)) {

forceOnlineInstall = true;

Expand Down

0 comments on commit 6ae687f

Please sign in to comment.