forked from twpayne/chezmoi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.txt
35 lines (28 loc) · 1.08 KB
/
init.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
[!exec:git] stop
mkhomedir
# test that chezmoi init creates a git repo
chezmoi init
exists ${CHEZMOISOURCEDIR}${/}.git
# create a commit
chezmoi add $HOME${/}.bashrc
cmp ${CHEZMOISOURCEDIR}${/}dot_bashrc $HOME${/}.bashrc
chezmoi git add dot_bashrc
chezmoi git commit -- --message 'Add dot_bashrc'
# test that chezmoi init fetches git repo but does not apply
chhome home2${/}user
chezmoi init file://$WORK/home/user/.local/share/chezmoi
exists ${CHEZMOISOURCEDIR}${/}.git
! exists $HOME${/}.bashrc
# test that chezmoi init --apply fetches a git repo and runs chezmoi apply
chhome home3${/}user
chezmoi init --apply file://$WORK/home/user/.local/share/chezmoi
exists ${CHEZMOISOURCEDIR}${/}.git
grep '# contents of .bashrc' $HOME${/}.bashrc
# test that chezmoi init does not clone the repo if it is already checked out but does create the config file
chhome home4${/}user
chezmoi init --source=${HOME}/dotfiles --verbose file://$WORK/nonexistentrepo
exists ${CHEZMOICONFIGDIR}/chezmoi.toml
-- home4/user/dotfiles/.git/.keep --
-- home4/user/dotfiles/.chezmoi.toml.tmpl --
[data]
email = "user@home.org"