Skip to content

Commit

Permalink
update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
di-sukharev committed Nov 26, 2023
1 parent ec05081 commit 374073d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 57 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ AITDD runs on [Bun](https://bun.sh/), installing AITDD will install latest Bun.
aitdd config set OPENAI_API_KEY <your_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:

```sh
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

Expand Down
6 changes: 4 additions & 2 deletions src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
}
}
Expand Down
53 changes: 0 additions & 53 deletions src/utils/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> => {
// const { stdout } = await execa("git", ["config", "core.hooksPath"]);

// return stdout;
// };

// export const getStagedFiles = async (): Promise<string[]> => {
// 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<string[]> => {
await assertGitRepo();

Expand All @@ -83,13 +37,6 @@ export const getChangedFiles = async (): Promise<string[]> => {
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) =>
Expand Down

0 comments on commit 374073d

Please sign in to comment.