mksourcedir

# test duplicate source state entry detection
cp $CHEZMOISOURCEDIR/dot_file $CHEZMOISOURCEDIR/empty_dot_file
! exec chezmoi verify
stderr 'inconsistent state'

chhome home2/user

# test invalid config
! exec chezmoi verify
stderr 'invalid config'

chhome home3/user

# test source directory is not a directory
! exec chezmoi verify
stderr 'not a directory'

chhome home4/user

# test that chezmoi checks .chezmoiversion
! exec chezmoi verify
stderr 'source state requires chezmoi version'

chhome home5/user
# test that chezmoi checks .chezmoiversion when .chezmoiroot is used
! exec chezmoi verify
stderr 'source state requires chezmoi version'

chhome home6/user

# test duplicate script detection
! exec chezmoi verify
stderr 'inconsistent state'

chhome home7/user

# test that chezmoi init returns an error if there are multiple config file templates
! exec chezmoi init
stderr 'multiple config file templates'

chhome home8/user

# test that chezmoi verify returns an error if there are multiple config files
! exec chezmoi verify
stderr 'multiple config files'

# FIXME add more tests

-- home2/user/.config/chezmoi/chezmoi.json --
{
-- home3/user/.local/share/chezmoi --
# contents of .local/share/chezmoi
-- home4/user/.local/share/chezmoi/.chezmoiversion --
3.0.0
-- home5/user/.local/share/chezmoi/.chezmoiroot --
home
-- home5/user/.local/share/chezmoi/.chezmoiversion --
3.0.0
-- home6/user/.local/share/chezmoi/run_install_packages --
# contents of install_packages
-- home6/user/.local/share/chezmoi/run_once_install_packages --
# contents of install_packages
-- home7/user/.local/share/chezmoi/.chezmoi.json.tmpl --
-- home7/user/.local/share/chezmoi/.chezmoi.toml.tmpl --
-- home8/user/.config/chezmoi/chezmoi.json --
-- home8/user/.config/chezmoi/chezmoi.toml --
-- home8/user/.local/share/chezmoi/.keep --
