Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Improve documentation on using separate source files
- Loading branch information
Showing
2 changed files
with
42 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# test that chezmoi supports separate files via templates | ||
exec chezmoi apply | ||
cmp $HOME/.file1 golden/file1 | ||
cmp $HOME/.file2 golden/file2 | ||
|
||
-- golden/file1 -- | ||
# contents of .file1 | ||
-- golden/file2 -- | ||
# contents of .file2 | ||
-- home/user/.local/share/chezmoi/.chezmoitemplates/file2.tmpl -- | ||
# {{ . }} | ||
-- home/user/.local/share/chezmoi/.file1 -- | ||
# contents of .file1 | ||
-- home/user/.local/share/chezmoi/dot_file1.tmpl -- | ||
{{- include ".file1" -}} | ||
-- home/user/.local/share/chezmoi/dot_file2.tmpl -- | ||
{{- template "file2.tmpl" "contents of .file2" -}} |