[][src]Crate badm

badm is a tool that stores your configuration files, or dotfiles, in a directory that replicates the directory hierarchy of the dotfiles' original path, and creates symlinks to their original paths. This creates a standardized and systematic approach for managing, deploying, and sharing dotfiles among different systems and users.

badm is ultimately "But Another Dotfiles Manager".

Examples

  • ferris has created a directory to store their dotfiles at ~/.dots
  • badm set-dir ~/.dots sets the BADM dotfiles dir at ~/.dots
  • badm will search for a badm config file at one of the two valid locations: $HOME and $XDG_CONFIG_HOME. If the config file not found, badm will create it under $HOME
/home
└── ferris
    └── .dots
        ├── .badm.toml
        └── .gitconfig
  • to store ~/.gitconfig as a dotfile, ferris runs badm stow ~/.gitconfig (relative paths work as well)
  • badm replicates the path of the dotfile under the ~/.dots directory
  • the dotfile is moved to this new path in the set dotfiles directory and symlinked at its original path which points to its new path
/home
└── ferris
    ├── .badm.toml
    ├── .dots
    │   └── home
    │       └── ferris
    │           └── .gitconfig
    └── .gitconfig -> /home/ferris/.dots/home/ferris/.gitconfig

Commands

  • badm set-dir <DIRECTORY> - set dotfiles directory location, if the location is not created BADM has the ability to create one for you
  • badm stow <FILE> - store a file in the dotfiles directory, create a symlink at the original source of the stowed file.
  • badm deploy <FILE> - for new configurations, create symlinks in directories relative to the dotfile's directory hierarchy. Directories to replicate the stored dotfile's directory structure will be created if not found.
  • badm restore <FILE> - restore the stored file from the dotfiles directory and replace the symlink with the original file

Modules

commands

Includes the commands used by the badm crate/application.

paths

Includes paths/fs-specific helper functions.

Structs

Config

Handles and saves configuration variables between application calls.

DirScanner

Struct used to traverse directories and collect entries located within.

FileHandler

Moves, stores, and creates files and symlinks.

Enums

InputError