-
-
Notifications
You must be signed in to change notification settings - Fork 136
Specs
DRAFT
All that define rcm behavior
May be included in man pages one day ?
The file is not mandatory, but always searched for.
- If
RCRC
variable is set, use the contents as target location for rcrc file. - Else target location is
$HOME/.rcrc
If file does not exist at target, consider no file exists.
Locations checked, in order :
- The ones specified with
-d
option on commandline - The ones specified in RCRC file
- The last location check is the default, currently
$HOME/.dotfiles
-
mkrc
- Currently, in mkrc, we get the first defined path, even if it doesn't exist. It will be created if not available (and if permissions allow it).
- In
fix_mkrc_doc_206
branch, we stop at the first existing directory, and abort if none found
-
rcup, rcdn and lsrc have the same behavior
- Currently, if a
-d
option is given, it overrides the values in RCRC - The default value is appended to the list.
- Currently, if a
mkrc registers files in your dotfiles directory. The first in the list is used (check §"dotfiles location" above)
- Get specific options (includes reading
rcrc
file) - Identify all files to handle (wildcards from commandline)
- Automatically exclude files which are a symlink or located in a symlinked directory below
$HOME
- Automatically exclude files which are a symlink or located in a symlinked directory below
- Loop to
- create the path
- move the file there (without dot)
- install back with
rcup
- FIXME: mkrc builds all args for -S and -u => Move to one loop on files, and generate shorter commands to update, pushing symlink and undotted params to install_args
rcup updates $HOME
with files from your dotfiles directories.
FILES
arguments are files relative to $DOTFILES_DIR
- Get specific options (includes reading
RCRC
file) - Trigger
pre up
hooks - Use
lsrc
to list all files (origin and dest) - Loop on all files
- if file exists, try to replace it
- else link it
- Trigger
post up
hooks
Add sample usage of hooks
rcdn removes installed dotfiles from your $HOME
. It doesn't remove any files from the dotfiles directory
The Copied files are removed if they were added to the COPY_ALWAYS variable, either on commandline or in RCRC
- Get specific options (includes reading
RCRC
file) - Trigger
pre down
hooks - Use
lsrc
to list all files (origin and dest) - Loop on all files
- walk back the path from file to
$HOME
- if symlink exists, remove it
- if file exists and is in "COPY_ALWAYS", remove it
- walk back the path from file to
- Trigger
post down
hooks
Suggest a -C option to enforce a copied file to be removed without requiring the COPY_ALWAYS
Add sample usage of hooks
lsrc lists all dotfiles, at origin and destination, for all dotfiles directories found.
It is actually this program which computes how a file will be delivered.
- Get specific options (includes reading
RCRC
file) - Loop on all dotfiles directories (first found file takes precedence)
- if there is a host folder, walk into it and process files
- if there is a tag folder, walk into it and process files
- process standard files
File processing is:
- if current file doesn't exist, simply skip it
- if current file is excluded, skip it
- a file is excluded if its basename or its full path inside dotfiles directory match an exclusion
- if current file is a folder and is not in the SYMLINK_DIRS list
- recurse into it and loop back to File processing
- else (current file is not excluded or is a to-be-symlinked dir)
- build destination absolute path
- compute origin absolute path
- add sigil if required
- if destination wasn't already handled, display the pair
origin:destination
- already handled, by a
host-*
dir, atag-*
dir, or a previous dotfiles directory
- already handled, by a
Check if test exists for commit a7c2b6bed845b8512e878c992e07841ea9b88462