Chezmoi Config Tester is a lightweight Docker-based tool for testing your chezmoi configuration files in a controlled environment. This tool ensures your dotfiles work as expected without affecting your local setup.
- Docker installed on your machine.
-
Clone the repository or save the provided files (
Dockerfile
andtests.sh
) to your project directory. -
Ensure your chezmoi configurations are located in
~/.local/share/chezmoi
. -
Run the test script:
./test.sh
This will:
- Build a Docker image named
chezmoi-test
. - Start a container with your chezmoi configurations mounted to
/root/.local/share/chezmoi
. - Apply the configurations in the container and drop you into a shell for further testing.
- Build a Docker image named
To remove the Docker image and containers:
# Remove all containers using the image
docker rm $(docker ps -aq -f ancestor=chezmoi-test)
# Remove the image
docker rmi chezmoi-test
Contributions are welcome! Feel free to open issues or submit pull requests to improve this tool.