dfm is a tool for managing dotfiles. dfm works best when using git to manage dotfile but will also work without.
curl -o- https://raw.githubusercontent.com/bcaldwell/dfm/master/scripts/install.sh | bash Download the applicable binary from releases
--- # remote location of repository [optional] repo: git@github.com:bcaldwell/dotfiles.git # Links occur fron srcDir/path to destDir/path # location of source files. Defaults to $HOME/.dotfiles srcDir: /Home/user/.dotfiles # default location to link files relatively to. Defaults to $HOME destDir: /home/user # Tasks to run tasks: name: # Parameter to run the task when: # runs tasks when os matches os: darwin # runs the shell command and runs the task if exit code is 0 condition: "echo" # runs when the text after install matchs Ex: dfm install darwin parameter "darwin" # Runs if command doesnt exists in the shell notInstalled: "brew" # commands to run cmd: - "brew install" # Links to create links: - gitconfig:.gitconfig # task dependencies deps: - depend Process each tasks and excuses it
dfm install To use git to update the repository by running git fetch && git pull run:
dfm update Same as dfm update but runs dfm install afterwards:
dfm upgrade Runs the passed in git command in the source respository:
dfm git args Ex: dfm git status
Returns the path of the source respository. Useful for cd
cd $(dfm cd) Sets the location of the configuration file
dfm -config pathtoconfig/config.yml Enables verbose logging
dfm -verbose install Prints shell commands that would be excused without excusing them
dfm -dryrun install Overwrite previously existing files, folders or symlinks when linking files
dfm -overwrite install Forces commands to run with more power. Also overwrites previously existing files, folders or symlinks when linking files
dfm -force install To enable the dfm cd command, add the following to your profile (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).
function dfm () { if [ "$1" == "cd" ] then cd $(command dfm path) return 0 fi command dfm "$@" }