diff --git a/README.md b/README.md index d8e270d..fff9cc2 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ AITDD runs on [Bun](https://bun.sh/), installing AITDD will install latest Bun. aitdd config set OPENAI_API_KEY ``` - Your api key is stored locally in `~/.aitdd` config file and is not stored anywhere in any other way. + Your api key is stored locally in `~/.aitdd/config` config file and is not stored anywhere in any other way. 4. Set the command to run the tests: @@ -38,7 +38,7 @@ AITDD runs on [Bun](https://bun.sh/), installing AITDD will install latest Bun. aitdd config set RUN_TESTS "npm run test" ``` -Your api key is stored locally in `~/.aitdd` config file and is not stored anywhere in any other way. +Your api key is stored locally in `~/.aitdd/config` config file and is not stored anywhere in any other way. ## Example diff --git a/src/commands/config.ts b/src/commands/config.ts index 235727f..3a44d9b 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -88,7 +88,7 @@ export type ConfigType = { [key in CONFIG_KEYS]?: any; }; -const configPath = pathJoin(homedir(), ".aitdd"); +const configPath = pathJoin(homedir(), ".aitdd", "config"); export const getConfig = (): ConfigType | null => { const defaults = { @@ -133,7 +133,9 @@ export const getConfig = (): ConfigType | null => { outro( `'${configKey}' name is invalid, it should be either '${configKey.toUpperCase()}' or it doesn't exist.` ); - outro(`Manually fix the '.env' file or global '~/.aitdd' config file.`); + outro( + `Manually fix the '.env' file or global '~/.aitdd/config' config file.` + ); process.exit(1); } } diff --git a/src/utils/git.ts b/src/utils/git.ts index 72bf9b9..a304bf3 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -19,52 +19,6 @@ export const getIsGitRepo = async () => { } }; -// const excludeBigFilesFromDiff = ['*-lock.*', '*.lock'].map( -// (file) => `:(exclude)${file}` -// ); - -// export const getAITDDIgnore = (): Ignore => { -// const ig = ignore(); - -// try { -// ig.add(readFileSync(".aitddignore").toString().split("\n")); -// } catch (e) {} - -// return ig; -// }; - -// export const getCoreHooksPath = async (): Promise => { -// const { stdout } = await execa("git", ["config", "core.hooksPath"]); - -// return stdout; -// }; - -// export const getStagedFiles = async (): Promise => { -// const { stdout: gitDir } = await execa("git", [ -// "rev-parse", -// "--show-toplevel", -// ]); - -// const { stdout: files } = await execa("git", [ -// "diff", -// "--name-only", -// "--cached", -// "--relative", -// gitDir, -// ]); - -// if (!files) return []; - -// const filesList = files.split("\n"); - -// const ig = getAITDDIgnore(); -// const allowedFiles = filesList.filter((file) => !ig.ignores(file)); - -// if (!allowedFiles) return []; - -// return allowedFiles.sort(); -// }; - export const getChangedFiles = async (): Promise => { await assertGitRepo(); @@ -83,13 +37,6 @@ export const getChangedFiles = async (): Promise => { return files.sort(); }; -// export const gitAdd = async ({ files }: { files: string[] }) => { -// const gitAddSpinner = spinner(); -// gitAddSpinner.start('Adding files to commit'); -// await execa('git', ['add', ...files]); -// gitAddSpinner.stop('Done'); -// }; - export const getDiff = async ({ files }: { files: string[] }) => { const lockFiles = files.filter( (file) =>