Skip to content

Commit

Permalink
Add directory creation check in initLLMfromConfig method
Browse files Browse the repository at this point in the history
Add a check to create the directory if it doesn't exist before loading
the config file in the initLLMfromConfig method.

Generated by gpt-3.5-turbo
  • Loading branch information
joone committed Mar 8, 2024
1 parent 4c78a54 commit 6a83fd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/loz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ export class Loz {
}

async init() {
if (!fs.existsSync(this.configPath)) {
fs.mkdirSync(this.configPath);
}

if (checkGitRepo() === true) {
if (!fs.existsSync(LOG_DEV_PATH)) {
fs.mkdirSync(LOG_DEV_PATH);
Expand All @@ -73,6 +69,10 @@ export class Loz {

// load config from JSON file
private async initLLMfromConfig() {
if (!fs.existsSync(this.configPath)) {
fs.mkdirSync(this.configPath);
}

await this.config.loadConfig(this.configPath);

const api = this.checkAPI() || "openai";
Expand Down

0 comments on commit 6a83fd9

Please sign in to comment.