Skip to content

Commit

Permalink
update Browser.ts and src/utils/net/index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
fdciabdul committed Feb 10, 2025
1 parent ec84dbc commit 87e8542
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib/Browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export class LaunchBrowser {
*/
async init(): Promise<void> {
const driverPath = path.resolve("driver");

const sessionDir = path.resolve(`session/${this.username}`);
if (!fs.existsSync(sessionDir)) {
fs.mkdirSync(sessionDir, { recursive: true });
}
// Check if driver folder exists and is not empty
if (!fs.existsSync(driverPath) || fs.readdirSync(driverPath).length === 0) {
throw new Error("The 'driver' folder is empty or does not exist. Please ensure the necessary files are present.");
Expand Down
2 changes: 1 addition & 1 deletion src/utils/net/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class Downloader {

// Ensure the output directory exists
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir);
fs.mkdirSync(outputDir,{ recursive: true });
}

// Unzip using unzipper
Expand Down

0 comments on commit 87e8542

Please sign in to comment.