`init --local-only`: make the project's `.gitignore` ignore itself, and say what happened.
(
clack: { log: { success(message: string): void; info(message: string): void; warn(message: string): void } },
projectPath: string,
)
| 724 | |
| 725 | /** `init --local-only`: make the project's `.gitignore` ignore itself, and say what happened. */ |
| 726 | function applyLocalOnlyGitignore( |
| 727 | clack: { log: { success(message: string): void; info(message: string): void; warn(message: string): void } }, |
| 728 | projectPath: string, |
| 729 | ): void { |
| 730 | const file = `${path.basename(getCodeGraphDir(projectPath))}/.gitignore`; |
| 731 | switch (makeGitignoreLocalOnly(projectPath)) { |
| 732 | case 'written': |
| 733 | clack.log.success(`${file} now ignores itself, so nothing of CodeGraph's shows in git.`); |
| 734 | break; |
| 735 | case 'unchanged': |
| 736 | clack.log.info(`${file} already ignores itself.`); |
| 737 | break; |
| 738 | case 'customized': |
| 739 | clack.log.warn(`Left ${file} as it is because it has your own rules. A lone * in it would keep the whole folder out of git.`); |
| 740 | break; |
| 741 | case 'tracked': |
| 742 | clack.log.warn(`Left ${file} as it is because it is committed to this repository, so changing it would show up in git.`); |
| 743 | break; |
| 744 | } |
| 745 | } |
| 746 | |
| 747 | /** |
| 748 | * What `status` and `init` say about an index whose last run didn't end well: |
no test coverage detected