diff --git a/src/snyk/common/download/downloader.ts b/src/snyk/common/download/downloader.ts index 4281508c3..016d79792 100644 --- a/src/snyk/common/download/downloader.ts +++ b/src/snyk/common/download/downloader.ts @@ -2,6 +2,7 @@ import axios, { CancelTokenSource } from 'axios'; import * as fs from 'fs'; import * as fsPromises from 'fs/promises'; import * as stream from 'stream'; +import { mkdirSync } from 'fs'; import { Progress } from 'vscode'; import { Checksum } from '../../cli/checksum'; import { messages } from '../../cli/messages/messages'; @@ -44,6 +45,7 @@ export class Downloader { private async getCliExecutable(platform: CliSupportedPlatform): Promise { const cliPath = await this.configuration.getCliPath(); + mkdirSync(cliPath, { recursive: true }); if (await this.binaryExists(cliPath)) { await this.deleteFileAtPath(cliPath); }