/
root.txt
36 lines (30 loc) · 965 Bytes
/
root.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# test that chezmoi apply uses .chezmoiroot
chezmoi apply
cmp $HOME/.file golden/.file
# test that chezmoi add uses .chezmoiroot
symlink $HOME/.symlink -> .file
chezmoi add $HOME${/}.symlink
cmp $CHEZMOISOURCEDIR/home/symlink_dot_symlink golden/symlink_dot_symlink
[!exec:git] skip 'git not found in $PATH'
[windows] skip 'go-git does not support file:// URLs on windows'
chhome home2/user
mkgitconfig
# create a git repo in home2/user/repo
exec git -C $HOME/repo init
exec git -C $HOME/repo add .
exec git -C $HOME/repo commit -m 'Initial commit'
# test that chezmoi init uses .chezmoiroot
chezmoi init --apply file://$HOME/repo
cmp $HOME/.file golden/.file
-- golden/.file --
# contents of .file
-- golden/symlink_dot_symlink --
.file
-- home/user/.local/share/chezmoi/.chezmoiroot --
home
-- home/user/.local/share/chezmoi/home/dot_file --
# contents of .file
-- home2/user/repo/.chezmoiroot --
home
-- home2/user/repo/home/dot_file --
# contents of .file