feat: auto-configure git include.path in chezmoi init hook

This commit is contained in:
2025-12-20 00:19:09 -06:00
parent e51205cd49
commit 80c4082878
2 changed files with 23 additions and 15 deletions
+9
View File
@@ -11,6 +11,15 @@ const log = (...args: any[]): void => {
};
const filePath = join(homedir(), "key.txt");
const chezmoiSourceDir = join(homedir(), ".local", "share", "chezmoi");
// Configure git to include repo-local .gitconfig (for age diff support)
const gitIncludeResult = await $`git -C ${chezmoiSourceDir} config --local include.path ../.gitconfig`.quiet();
if (gitIncludeResult.exitCode === 0) {
log("git include.path configured");
} else {
log("warning: failed to configure git include.path");
}
if (await exists(filePath)) {
log("key.txt already exists");