Skip to content

Commit

Permalink
fix: ensure dir exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawkyZ committed Dec 9, 2024
1 parent c094338 commit 3b35b74
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/snyk/common/download/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -44,6 +45,7 @@ export class Downloader {

private async getCliExecutable(platform: CliSupportedPlatform): Promise<CliExecutable | null> {
const cliPath = await this.configuration.getCliPath();
mkdirSync(cliPath, { recursive: true });
if (await this.binaryExists(cliPath)) {
await this.deleteFileAtPath(cliPath);
}
Expand Down

0 comments on commit 3b35b74

Please sign in to comment.