diff options
author | Mike Burns <mike@mike-burns.com> | 2013-08-16 15:42:56 +0200 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2013-08-16 16:11:36 +0200 |
commit | 975b347b7206a0e9caeeea8349e4765b4db654f9 (patch) | |
tree | 7e993414fce578e351b38d0a761670ee551f22b0 /man/rcup.1 | |
parent | 526fb25aff2b27b46aaa4754f5b613ca1c97f8c3 (diff) |
Pre-up, post-up, pre-down, and post-down hooks
These are programs that, if they exist, will run before or after the
syncronization/removal is run. Three use cases caused this:
1. The thoughtbot dotfiles will run a vundle installation set of
commands after intitial synchronization.
2. I changed the location of `.bash_history` to `.bash/history` and
wanted to move `.bash_history` to `.bash/history` after up to preserve
existing history.
3. Moving from an existing old-style custom install script to `rcup`
might require some cleanup; this happened in practice, and required a
simple script.
Diffstat (limited to 'man/rcup.1')
-rw-r--r-- | man/rcup.1 | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -84,7 +84,8 @@ option in .Xr rcrc 5 can be used to list files that must only be copied. .Pp -Two meta files are supported: host-specific files and tagged files. +Three meta files are supported: host-specific files, tagged files, +hooks. .Pp Host-specific files go in a directory named for the host, prefixed with .Pa host- . @@ -93,8 +94,7 @@ For example, contains files specific to the computer with hostname .Pa scarlett , and these files will only be installed on the computer with hostname -.Pa scarlett -\&. +.Pa scarlett . .Pp Tagged files go in a directory named for the tag, prefixed with .Li tag- . @@ -103,18 +103,33 @@ Therefore, files under are only installed when installing using the .Li git tag. +.Pp +Hooks go in a directory named +.Pa hooks . +Two hooks are supported by +.Nm rcup : +pre-up and post-up . These go in files with predictable filenames: +.Pa .dotfiles/hooks/pre-up and +.Pa .dotfiles/hooks/post-up . +These files must be executable. They are run every time +.Nm +is run, and therefore must be idempotent. .Sh ALGORITHM It is instructive to understand the process .Nm rcup uses when synchronizing your rc files: .Bl -enum .It +The pre-up hook is run. +. +.It All non-host, non-tag files without a dot prefix are symlinked to the dotted filename in your home directory. So, .Pa .dotfiles/tigrc is symlinked to .Pa ~/.tigrc . +. .It All non-host, non-tag directories have their structure copied to your home directory, then a non-dotted symlink is created within. So for @@ -125,12 +140,14 @@ causes the directory to be created, then .Pa haskell.vim is symlinked within. +. .It Steps (1) and (2) are applied to host-specific files. These are files under a directory named .Sm off .Pa host- Va $HOSTNAME . .Sm on +. .It Steps (1) and (2) are applied to tag-specific files. These are files under directories named @@ -142,6 +159,9 @@ where is the name of each specified tag in turn, taken from the command line or from .Xr rcrc 5 . +. +.It +The post-up hook is run. .El . .Sh FILES |