`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,
)
| 705 | |
| 706 | /** `init --local-only`: make the project's `.gitignore` ignore itself, and say what happened. */ |
| 707 | function applyLocalOnlyGitignore( |
| 708 | clack: { log: { success(message: string): void; info(message: string): void; warn(message: string): void } }, |
| 709 | projectPath: string, |
| 710 | ): void { |
| 711 | const file = `${path.basename(getCodeGraphDir(projectPath))}/.gitignore`; |
| 712 | switch (makeGitignoreLocalOnly(projectPath)) { |
| 713 | case 'written': |
| 714 | clack.log.success(`${file} now ignores itself, so nothing of CodeGraph's shows in git.`); |
| 715 | break; |
| 716 | case 'unchanged': |
| 717 | clack.log.info(`${file} already ignores itself.`); |
| 718 | break; |
| 719 | case 'customized': |
| 720 | 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.`); |
| 721 | break; |
| 722 | case 'tracked': |
| 723 | clack.log.warn(`Left ${file} as it is because it is committed to this repository, so changing it would show up in git.`); |
| 724 | break; |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | /** |
| 729 | * The `init` flow — shared by `codegraph init` and `codegraph install --init` |
no test coverage detected