Skip to content

Commit

Permalink
Merge pull request #322 from ardriveapp/PE-2198
Browse files Browse the repository at this point in the history
  • Loading branch information
karlprieb authored Sep 1, 2022
2 parents a82e76a + 823c3e8 commit e8532a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/utils/temp_folder.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect } from 'chai';
import { cleanUpTempFolder, getTempFolder } from './temp_folder';
import * as fs from 'fs';
import * as os from 'os';

describe('temp folder functions', () => {
describe('getTempFolder function', () => {
Expand All @@ -19,8 +18,7 @@ describe('temp folder functions', () => {

it('returns a folder that contains the correct subfolders', () => {
const tempFolderPath = getTempFolder();
const expectedPathComponent =
os.platform() === 'win32' ? '\\ardrive-downloads' : '/.ardrive/ardrive-downloads';
const expectedPathComponent = 'ardrive-downloads';
expect(tempFolderPath).to.contains(expectedPathComponent);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/temp_folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ export function getTempFolder(): string {
export function cleanUpTempFolder(): void {
const tempFolderPath = platformTempFolder();
if (fs.existsSync(tempFolderPath)) {
fs.rmdirSync(tempFolderPath, { recursive: true });
fs.rmSync(tempFolderPath, { recursive: true });
}
}

0 comments on commit e8532a8

Please sign in to comment.