SuperCuber / dotter

A dotfile manager and templater written in rust 🦀
The Unlicense
901 stars 48 forks source link

[FEATURE] #175

Open WeiYiAcc opened 5 months ago

WeiYiAcc commented 5 months ago

Dotter Configuration Guide

Problem Statement

I felt frustrated with the example files and documentation. Despite Dotter being an excellent and user-friendly software that should typically take 10 minutes to set up, the lack of a minimalist example led to issues. Specifically, an empty source folder preventing symlink creation made me mistakenly believe there was a Windows permission problem, wasting considerable time.

Proposed Solution

Optimize the documentation with a clear, minimal example.

Directory Structure

dotfiles
│
├── .dotter
│   ├── cache.toml
│   ├── global.toml
│   ├── local.toml
│   └── windows.toml
│
├── source_path
│   └── not_be_empty_path.file  # This is a file. Deployment fails if empty.
│
└── source_file

Run dotter deploy in the root directory. Note that dotter deploy -d will fail.

Configuration Files

global.toml

[settings]
default_target_type = "symbolic"

[package_name_1]
depends = []

Note: I intentionally didn't write package_name_2. If there are no dependencies, you can omit writing them all.

local.toml

includes = [".dotter/windows.toml"]
packages = ["package_name_1", "package_name_2"]

windows.toml

[package_name_1.files]
# This is the location for Windows
"source_flle" = "~/target_file"

[package_name_2.files]
"source_path" = "~/target_path"

Important Notes

  1. The source_path directory must not be empty. The presence of not_be_empty_path.file is crucial for successful deployment.
  2. The correct way to include modules is:
    includes = [".dotter/windows.toml"]

This guide aims to provide a clear, minimal example to help users avoid common pitfalls and quickly set up Dotter on Windows systems.