mirror of
Fork 0
Commit Graph

51 Commits

Author SHA1 Message Date
Anish Athalye 1e1885c45a Fix incorrect use of `is` over `==`
Comparing strings and integers with `is` is a bug: comparisons should be
done with `==`. It might not have caused observable problems in the past
because small integers and strings can be interned.
2020-01-03 15:31:24 -05:00
Anish Athalye e38e021ab3 Add option to clean recursively 2019-12-31 19:14:23 -05:00
Anish Athalye 81f0d74955 Fix clean not respecting defaults
Previously, clean read the defaults once, and then it updated the
setting for each entry it read. This resulted in the defaults being
clobbered and then not being respected for subsequent entries. This
patch fixes the issue by re-reading the defaults before processing each

The other plugins (link, shell) do not have this problem.
2019-12-31 14:47:32 -05:00
Albert Puig eabd84bce1 Add ignore-missing option to link 2019-12-31 14:25:53 -05:00
Anish Athalye 5bb3c8a343 Release 1.16.0 2019-10-12 12:02:40 -04:00
Jesse Leite 5a0f6676d4 Add 'create' directive to create directories 2019-10-12 11:55:09 -04:00
ronalabraham 017c70b5b0
Change `target` to `source` for consistency with docs 2019-06-04 15:20:00 -04:00
Anish Athalye 5d74f29001 Release 1.15.0 2018-11-21 19:52:03 -05:00
Anish Athalye 5e2d40939e Merge branch 'thtliife/suppress-shell-cmd' 2018-11-21 19:50:46 -05:00
Anish Athalye 8558a5dca0 Release 1.14.1 2018-11-19 20:39:19 -05:00
Bao Trinh 7add866215
Support defining default conditional option for links 2018-11-17 15:00:18 -06:00
Anish Athalye e35b0794fd Release 1.14.0 2018-10-16 20:52:09 -04:00
Ben Klein a9cf9fffe4 Implement conditional linking 2018-10-16 20:22:40 -04:00
Philip Hallstrom a22d980cdf Add option --no-color to suppress colorization of output
By default, if output is a TTY, dotbot will colorize the output. This
patch adds the option to pass `--no-color` to dotbot to have it suppress
this colorization.
2018-10-06 16:08:26 -07:00
Derek P Sifford cf55ca5188 Fix clean path expansion to expand env vars 2018-08-06 20:41:42 -04:00
Anish Athalye f95cbe2705 Release 1.12.4 2018-06-18 09:30:11 -04:00
Anish Athalye 9d967ad7e8 Include built-in plugins in PyPI distribution 2018-06-11 21:14:10 -04:00
Anish Athalye a22838db76 Release 1.12.3 2018-06-03 15:46:52 -04:00
Anish Athalye 49b29da8e7 Release 1.12.2 2018-06-01 08:00:50 -04:00
Anish Athalye 30caaf2780 Add PyPI package
This patch also makes the '-d' argument optional, with the base
directory defaulting to the directory of the configuration file.
2018-05-30 10:23:53 -04:00
Anish Athalye c3f271481a Fix handling of base directory
Prior to this patch, Dotbot was relying on running with the base
directory being the current working directory. In practice, it was
relying on the install shim to set up this context. It makes more sense
sense to actually execute `chdir()` within Dotbot itself, rather than
relying on the install shim to do so.
2018-05-24 12:57:49 -04:00
Ben Klein dece710399 Implement globbing support 2018-04-13 08:49:02 -04:00
Anish Athalye f52bbd1eec Add default options
This feature was implemented with feedback from Aleks Kamko
<aykamko@gmail.com> and Casey Rodarmor <casey@rodarmor.com>.
2016-03-03 09:42:50 -05:00
Casey Rodarmor eeb4c284fb Add plugin loader 2016-02-06 15:14:35 -05:00
Anish Athalye 582edd6bd3 Fix compatibility with Python 3
This patch removes a stray print statement that was causing problems
with Python 3.
2016-01-15 01:21:16 -05:00
Anish Athalye 47ad7f4d3b Use file extension to select config file parser
This patch makes Dotbot provide better error messages when parsing JSON
2016-01-13 13:46:41 -05:00
Anish Athalye c48d16cbce Use standard library JSON parser for JSON files
This patch reverts the changes to the README made in
57265f78b4 and makes it so that Dotbot
supports JSON files with tab characters.
2016-01-13 11:29:12 -05:00
Anish Athalye 4381c4cabb Use `safe_load` function to load YAML
In our use case, we are *not* reading arbitrary input that could be
malicious. Still, because we know that what we're reading is made up of
only dictionaries and lists and not arbitrary Python objects, we might
as well use the more restrictive `safe_load` function rather than the
`load` function.
2015-08-03 17:47:32 -07:00
Anish Athalye fd7f3b8551 Add environment variable expansion in link paths
This feature was proposed by Brian Knobbs <brian@redlattice.com>.
2015-05-12 20:28:58 -04:00
Anish Athalye 3725d21684 Add functionality to overwrite broken links
This commit adds an option to the extended configuration syntax for
linking files and directories. The relink option is a safe alternative
to forcibly linking that only removes broken symbolic links, so it
cannot result in data loss.
2015-05-02 22:30:14 -04:00
Andreas Ntaflos 1a10f88c43 Handle force creation of symlinked directories
Check if entry to force-create (delete) is a symlink and if so, simply
unlink it. Don't try to run rmtree on the underlying directory, which
will fail anyway.
2015-04-27 22:58:22 +02:00
Anish Athalye 3c60899895 Improve error message for malformed files
This patch makes Dotbot warn the user and gracefully exit when the
configuration file is not a list.
2015-04-26 19:46:14 -04:00
Joshua Blum 56d8d05e77 Provide exception information when reading config 2015-04-24 18:33:13 -04:00
Anish Athalye fd08ddacd3 Fix style
Fix formatting of keyword arguments according to PEP 8.
2015-04-24 18:26:20 -04:00
Anish Athalye 38c0f65801 Add more options for shell commands
This commit introduces an extended configuration syntax for shell
commands. This syntax allows for specifying whether the stdin, stdout,
and stderr streams are enabled.
2015-02-03 11:53:05 -05:00
Anish Athalye 0b4b79e422 Allow nonexistent directories to be cleaned
Make nonexistent directories be skipped when cleaning.
2015-01-26 10:38:08 -05:00
Anish Athalye 69502854aa Fix compatibility
This commit fixes usage of the Singleton metaclass so that it is
compatible with both Python 2 and Python 3.
2015-01-26 10:36:36 -05:00
Anish Athalye c638e25941 Clean up code
Fix typos and remove unused code.
2015-01-26 10:36:11 -05:00
Anish Athalye bc43348f42 Fix bug with forced links not working in all cases
This commit fixes a bug where forced links did not work on certain types
of bad links. Until this fix, forced links only worked if the original
was a real file or directory. This commit fixes this, so that the forced
link option also works when the original is a broken or incorrect
symbolic link.
2014-11-09 09:08:13 -05:00
Anish Athalye 33d602bb93 Add YAML support
Add support for YAML format configuration files. In addition, this
commit adds instructions about YAML config files to the README, and it
also changes the README to encourage use of YAML instead of JSON.
2014-10-27 20:31:40 -04:00
Anish Athalye afebc0bb2f Add functionality to create parent directories
This commit introduces an additional option for extended configuration
syntax for linking. It adds the "create" parameter which results in
automatically creating a parent directory if necessary before linking a
2014-10-22 14:44:40 -04:00
Anish Athalye 13c925be87 Add functionality to forcibly link items
This commit introduces an extended configuration syntax for linking
files and directories. Currently, this syntax allows for specifying
items to be forcibly linked, overwriting existing files or directories
if necessary.

The extended configuration syntax was proposed by Travers McInerney
2014-10-22 14:42:23 -04:00
Anish Athalye 1733b54c87 Fix whitespace error 2014-10-17 10:05:47 -04:00
Anish Athalye 09a80230f5 Clean up code 2014-08-20 14:00:00 -07:00
Anish Athalye 92ed009245 Add keyboard interrupt handler 2014-07-19 00:29:49 -07:00
Anish Athalye 5394184d14 Display better error message when linking fails
When failing to symbolically linking files, display the names of the
files that could not be linked. This makes it easier to troubleshoot the
error without having to manually figure out which files failed to link.
2014-07-17 13:40:08 -07:00
Anish Athalye a97096ef96 Make Linker check for existence of targets
Linker now reports an error when links are configured to point to
nonexistent targets. This fixes the old behavior where Linker silently
created invalid links.
2014-07-15 18:25:53 -07:00
Anish Athalye 7200832465 Fix source compatibility with Python 3
According to PEP 394, `python` should only be used in the shebang line
for scripts that are source compatible with both Python 2 and Python 3.

In previous versions of Dotbot, on certain systems where `python`
referred to `python3`, running Dotbot would throw an exception due to a
SyntaxError. This can be fixed by making Dotbot source compatible with
both Python 2 and Python 3.
2014-06-14 23:56:33 -07:00
Anish Athalye abb825048b Add Cleaner executor 2014-06-08 11:32:45 -07:00
Anish Athalye e85dbfb7dd Remove code duplication in executors 2014-04-24 15:41:34 -04:00