NAME
link-files - Create symlinks in one directory for files in another
SYNOPSIS
link-files <options>
Options:
-n, --dry-run Don't actually do anything
-s DIR, --source=DIR The source directory
-d DIR, --dest=DIR The destination directory
-r, --recursive Recurse into subdirectories (see below)
-i RX, --ignore=RX A regex matching files to ignore (see below)
-a RX, --add-ignore=RX Like -i but doesn't replace the default
-f, --force Overwrite existing files/dirs
-h, --help Display this help message
-v, --version Display version information
By default, link-files will create symlinks in the destination directory for all top-level files, directories or symlinks found in the source directory. This is very useful for keeping the dot files in your $HOME
under version control. A typical use case:
cd ~/src/dotfiles
# update or add files, commit to repository
link-files --source . --dest ~
With --recursive
, link-files will not create symlinks to subdirectories found in the source directory. It will instead recurse into them and create symlinks for any files or symlinks it finds. Any subdirectories not found in the destination directory will be created. This approach is useful for destination directories where programs or users other than yourself might add things to subdirectories which you don't want ending up in your working tree implicitly. /etc is a good example.
In both cases, symlinks from the source directory will be copied as-is. This makes sense because the symlinks might be relative.
If --ignore
is not specified, it defaults to ignoring .git and .svn directories and their contents. When you supply your own regex, note that it will be matched only against the filename after any directories have been stripped from the string.
AUTHOR
Hinrik Örn Sigurðsson, hinrik.sig@gmail.com
LICENSE AND COPYRIGHT
Copyright 2009 Hinrik Örn Sigurðsson
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.