This example is my actual dotfile environment.
I have two working environments, macOS and ubuntu. The dotfiles in these environments are slightly different, so each dotfile is separated.
$HOME/dotfiles
├── common
│ ├── bin
│ │ ├── git-delete-other-branches
│ │ └── git-reset-and-clean
│ ├── git
│ │ └── ignore
│ ├── rubygems
│ │ └── .gemrc
│ └── vim
│ └── .vimrc
├── macOS
│ ├── bash
│ │ ├── .bash_profile
│ │ └── .bashrc
│ ├── git
│ │ └── .gitconfig
│ ├── karabiner
│ │ └── tab-emulation.json
│ └── vscode
│ ├── keybindings.json
│ └── settings.json
├── ubuntu
│ ├── bash
│ │ └── .bashrc
│ ├── bin
│ │ ├── upgrade-ghcli
│ │ ├── utils
│ │ ├── x-copy
│ │ └── x-open
│ ├── git
│ │ └── .gitconfig
│ ├── vscode
│ │ ├── keybindings.json
│ │ └── settings.json
│ └── xkeysnail
│ ├── config.py
│ ├── debug.sh
│ ├── restart.sh
│ ├── start.sh
│ └── stop.sh
├── macOS.yml
├── ubuntu.yml
└── Rakefile
When you run the rake -T
command in that directory structure, you should have two installation commands available:
$ rake -T
rake clear_backups # Clear all backups
rake install:macOS # Install dotfiles for macOS
rake install:ubuntu # Install dotfiles for ubuntu
macOS.yml
and ubuntu.yml
are for setting the link destination of dotfile. dotfile will be installed according to its setting.
For example, common -> bin -> git-delete-other-branchs
is $HOME/dotfiles/common/bin/git-delete-other-branches
.
And the value bin
means $HOME/bin
directory.
So this defines linking $HOME/dotfiles/common/bin/git-delete-other-branches
to $HOME/bin/git-delete-other-branches
.
See macOS.yml
See ubuntu.yml
See Installing
already_linked
means skipped because bin/git-delete-other-branches
is already linked. link_created
means the link was created.
Also, (backup)
means that a file exists in the link path and that file was backed up to $HOME/dotfiles/backup/YYYYMMDDHHIISS/filename
.
You can clear all backups in $HOME/dotfiles/backup/YYYYMMDDHHIISS
to run rake clear_backups
.
$ rake clear_backups