mirror of
https://github.com/Xevion/dotfiles.git
synced 2026-01-31 06:24:13 -06:00
feat: auto-configure git include.path in chezmoi init hook
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user