Pre 1.3.0

This commit is contained in:
TheNetsky
2023-11-23 14:38:58 +01:00
parent 1d6167aeca
commit 28286ff9fe
14 changed files with 285 additions and 203 deletions

View File

@@ -32,4 +32,20 @@ export function loadConfig(): Config {
} catch (error) {
throw new Error(error as string)
}
}
export async function loadSesion(sessionPath: string, email: string): Promise<string> {
try {
// Fetch path
const sessionDir = path.join(__dirname, '../browser/', sessionPath, email)
// Create session dir
if (!fs.existsSync(sessionDir)) {
await fs.promises.mkdir(sessionDir, { recursive: true })
}
return sessionDir
} catch (error) {
throw new Error(error as string)
}
}