From fa33cda9e6c95799946b6fbcd0e811ba5135c1e7 Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Wed, 9 Jan 2019 20:28:38 -0500 Subject: [PATCH 1/6] Add Python 3.7 to Travis CI tests --- .travis.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c94ea4..57a5877 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,26 @@ language: python -python: - - "2.7" - - "pypy" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "nightly" - - "pypy3" sudo: false +.mixins: + - &xenial + dist: xenial + +jobs: + include: + - python: "2.7" + - python: "pypy" + - python: "3.2" + - python: "3.3" + - python: "3.4" + - python: "3.5" + - python: "3.6" + - <<: *xenial + python: "3.7" + - <<: *xenial + python: "3.8-dev" + - python: "nightly" + - python: "pypy3" + script: - ./test/test_travis From cd04d886fe61d58bfb1a24ef6a5963f504ee092e Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Wed, 9 Jan 2019 20:46:21 -0500 Subject: [PATCH 2/6] Update dates --- LICENSE.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 1af799f..922999c 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ The MIT License (MIT) ===================== -**Copyright (c) 2014-2018 Anish Athalye (me@anishathalye.com)** +**Copyright (c) 2014-2019 Anish Athalye (me@anishathalye.com)** Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index 2416d3a..c866808 100644 --- a/README.md +++ b/README.md @@ -392,7 +392,7 @@ Packaging License ------- -Copyright (c) 2014-2018 Anish Athalye. Released under the MIT License. See +Copyright (c) 2014-2019 Anish Athalye. Released under the MIT License. See [LICENSE.md][license] for details. [PyPI]: https://pypi.org/project/dotbot/ From b062aeaf15f1b174f6c9b88a0b2017b06d7fbd3e Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Wed, 6 Feb 2019 09:30:49 -0500 Subject: [PATCH 3/6] Simplify README This patch removes JSON examples from the README. --- README.md | 72 ++++++++++--------------------------------------------- 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index c866808..3e1e51b 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ you're just looking for [some inspiration][inspiration], we've got you covered. The following will help you get set up using Dotbot in just a few steps. -If you're using Git, you can add Dotbot as a submodule: +If you're using **Git**, you can add Dotbot as a submodule: ```bash cd ~/.dotfiles # replace with the path to your dotfiles @@ -44,7 +44,7 @@ cp dotbot/tools/git-submodule/install . touch install.conf.yaml ``` -If you're using Mercurial, you can add Dotbot as a subrepo: +If you're using **Mercurial**, you can add Dotbot as a subrepo: ```bash cd ~/.dotfiles # replace with the path to your dotfiles @@ -108,43 +108,15 @@ The conventional name for the configuration file is `install.conf.yaml`. - [git submodule update --init --recursive, Installing submodules] ``` -The configuration file can also be written in JSON. Here is the JSON equivalent -of the YAML configuration given above. - -The conventional name for this file is `install.conf.json`. - -```json -[ - { - "defaults": { - "link": { - "relink": true - } - } - }, - { - "clean": ["~"] - }, - { - "link": { - "~/.dotfiles": "", - "~/.tmux.conf": "tmux.conf", - "~/.vim": "vim", - "~/.vimrc": "vimrc" - } - }, - { - "shell": [ - ["git submodule update --init --recursive", "Installing submodules"] - ] - } -] -``` +The configuration file is typically written in YAML, but it can also be written +in JSON (which is a subset of YAML). [Here][json-equivalent] is the JSON +[equivalent][json2yaml] of the YAML configuration given above. JSON +configuration files are conventionally named `install.conf.json`. Configuration ------------- -Dotbot uses YAML or JSON formatted configuration files to let you specify how +Dotbot uses YAML or JSON-formatted configuration files to let you specify how to set up your dotfiles. Currently, Dotbot knows how to [link](#link) files and folders, execute [shell](#shell) commands, and [clean](#clean) directories of broken symbolic links. Dotbot also supports user [plugins](#plugins) for custom @@ -161,7 +133,9 @@ Tasks are run in the order in which they are specified. Commands within a task do not have a defined ordering. When writing nested constructs, keep in mind that YAML is whitespace-sensitive. -Following the formatting used in the examples is a good idea. +Following the formatting used in the examples is a good idea. If a YAML +configuration file is not behaving as you expect, try inspecting the +[equivalent JSON][json2yaml] and check that it is correct. Also, note that `~` in YAML is the same as `null` in JSON. If you want a single character string containing a tilde, make sure to enclose it in quotes: `'~'` @@ -212,7 +186,7 @@ Available extended configuration parameters: If the source location is omitted or set to `null`, Dotbot will use the basename of the destination, with a leading `.` stripped if present. This makes -the following three config files equivalent: +the following config files equivalent: ```yaml - link: @@ -244,28 +218,6 @@ the following three config files equivalent: relink: true ``` -```json -[ - { - "link": { - "~/bin/ack": null, - "~/.vim": null, - "~/.vimrc": { - "relink": true - }, - "~/.zshrc": { - "force": true - }, - "~/.config/": { - "glob": true, - "path": "config/*", - "relink": true - } - } - } -] -``` - ### Shell Shell commands specify shell commands to be run. Shell commands are run in the @@ -400,6 +352,8 @@ Copyright (c) 2014-2019 Anish Athalye. Released under the MIT License. See [dotfiles-template]: https://github.com/anishathalye/dotfiles_template [inspiration]: https://github.com/anishathalye/dotbot/wiki/Users [managing-dotfiles-post]: http://www.anishathalye.com/2014/08/03/managing-your-dotfiles/ +[json-equivalent]: https://gist.github.com/anishathalye/84bd6ba1dbe936e05141e07ec45f5fd4 +[json2yaml]: https://www.json2yaml.com/ [wiki]: https://github.com/anishathalye/dotbot/wiki [contributing]: CONTRIBUTING.md [license]: LICENSE.md From c97472bc27fc7523bb621660c029665a8e300a6d Mon Sep 17 00:00:00 2001 From: ronalabraham Date: Tue, 4 Jun 2019 14:42:21 -0400 Subject: [PATCH 4/6] Fix `path` parameter's docs for linking feature --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e1e51b..5faf3f3 100644 --- a/README.md +++ b/README.md @@ -160,11 +160,11 @@ Available extended configuration parameters: | Link Option | Explanation | | -- | -- | -| `path` | The target for the symlink, the same as in the shortcut syntax (default:null, automatic (see below)) | +| `path` | The source for the symlink, the same as in the shortcut syntax (default:null, automatic (see below)) | | `create` | When true, create parent directories to the link as needed. (default:false) | | `relink` | Removes the old target if it's a symlink (default:false) | | `force` | Force removes the old target, file or folder, and forces a new link (default:false) | -| `relative` | Use a relative path when creating the symlink (default:false, absolute links) | +| `relative` | Use a relative path to the source when creating the symlink (default:false, absolute links) | | `glob` | Treat a `*` character as a wildcard, and perform link operations on all of those matches (default:false) | | `if` | Execute this in your `$SHELL` and only link if it is successful. | From 017c70b5b0d11c07afac435215be647ef2f3c6c1 Mon Sep 17 00:00:00 2001 From: ronalabraham Date: Tue, 4 Jun 2019 15:20:00 -0400 Subject: [PATCH 5/6] Change `target` to `source` for consistency with docs --- dotbot/plugins/link.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dotbot/plugins/link.py b/dotbot/plugins/link.py index 2506237..0b47ac6 100644 --- a/dotbot/plugins/link.py +++ b/dotbot/plugins/link.py @@ -84,7 +84,7 @@ class Link(dotbot.Plugin): success &= self._create(destination) if not self._exists(os.path.join(self._context.base_directory(), path)): success = False - self._log.warning('Nonexistent target %s -> %s' % + self._log.warning('Nonexistent source %s -> %s' % (destination, path)) continue if force or relink: @@ -227,10 +227,10 @@ class Link(dotbot.Plugin): # again, we use absolute_source to check for existence elif not self._exists(absolute_source): if self._is_link(link_name): - self._log.warning('Nonexistent target %s -> %s' % + self._log.warning('Nonexistent source %s -> %s' % (link_name, source)) else: - self._log.warning('Nonexistent target for %s : %s' % + self._log.warning('Nonexistent source for %s : %s' % (link_name, source)) else: self._log.lowinfo('Link exists %s -> %s' % (link_name, source)) From 9a8d292681ac540894dce3fe998be0068dfa2df5 Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Wed, 26 Jun 2019 15:00:07 -0400 Subject: [PATCH 6/6] Make launcher prefer python over python3 This patch makes the launcher script prefer `python`, when present, over `python3`. This way, the launcher uses the user's preferred `python` (which is often set up as a symbolic link to a particular python2.x or python3.x), when available. --- bin/dotbot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dotbot b/bin/dotbot index 123fc93..a2ffe9a 100755 --- a/bin/dotbot +++ b/bin/dotbot @@ -7,8 +7,8 @@ # is useful because we don't know the name of the python binary. ''':' # begin python string; this line is interpreted by the shell as `:` -which python3 >/dev/null 2>&1 && exec python3 "$0" "$@" which python >/dev/null 2>&1 && exec python "$0" "$@" +which python3 >/dev/null 2>&1 && exec python3 "$0" "$@" which python2 >/dev/null 2>&1 && exec python2 "$0" "$@" >&2 echo "error: cannot find python" exit 1