`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,
)
| 734 | |
| 735 | /** `init --local-only`: make the project's `.gitignore` ignore itself, and say what happened. */ |
| 736 | function applyLocalOnlyGitignore( |
| 737 | clack: { log: { success(message: string): void; info(message: string): void; warn(message: string): void } }, |
| 738 | projectPath: string, |
| 739 | ): void { |
| 740 | const file = `${path.basename(getCodeGraphDir(projectPath))}/.gitignore`; |
| 741 | switch (makeGitignoreLocalOnly(projectPath)) { |
| 742 | case 'written': |
| 743 | clack.log.success(`${file} now ignores itself, so nothing of CodeGraph's shows in git.`); |
| 744 | break; |
| 745 | case 'unchanged': |
| 746 | clack.log.info(`${file} already ignores itself.`); |
| 747 | break; |
| 748 | case 'customized': |
| 749 | 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.`); |
| 750 | break; |
| 751 | case 'tracked': |
| 752 | clack.log.warn(`Left ${file} as it is because it is committed to this repository, so changing it would show up in git.`); |
| 753 | break; |
| 754 | } |
| 755 | } |
| 756 | |
| 757 | /** |
| 758 | * What `status` and `init` say about an index whose last run didn't end well: |
no test coverage detected