Skip to content

Commit 3e84090

Browse files
committed
Fix fs module usage
1 parent a3e5e25 commit 3e84090

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { query, Session } from ".";
22

33
// Create a new session instance
4-
const session = new Session("/tmp");
4+
const session = new Session("./chdb-bun-tmp");
55
var result;
66

77
// Test standalone query

index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { dlopen, FFIType } from "bun:ffi";
2-
import fs from "fs";
2+
import { rmdirSync, mkdtempSync } from 'fs';
33

44
const path = `chdb_bun.so`;
55

@@ -39,7 +39,7 @@ class Session {
3939
constructor(path: string = "") {
4040
if (path === "") {
4141
// Create a temporary directory
42-
this.path = fs.mkdtempSync("tmp-");
42+
this.path = mkdtempSync("tmp-");
4343
this.isTemp = true;
4444
} else {
4545
this.path = path;
@@ -49,7 +49,7 @@ class Session {
4949

5050
// Cleanup method to delete the temporary directory
5151
cleanup() {
52-
fs.rmdirSync(this.path, { recursive: true });
52+
rmdirSync(this.path, { recursive: true, force: true });
5353
}
5454
}
5555

0 commit comments

Comments
 (0)