1
0
Fork 0
mirror of synced 2024-11-03 00:48:57 -04:00
Commit graph

80 commits

Author SHA1 Message Date
Anish Athalye
d2f76a2593 Merge branch 'kurtmckee/update-vm-os' 2022-04-11 08:05:50 -04:00
Kurt McKee
57c7c513b9 Update the Vagrantfile target OS to Ubuntu jammy
This resolves VirtualBox 5.x/6.x Guest Additions incompatibilities
that cause all of the unit tests to fail under VirtualBox 6.1.

Fixes #305
2022-04-10 22:24:19 -05:00
Kurt McKee
1931c9ac06 Update the unauthenticated git protocol to HTTPS
The unauthenticated git protocol is no longer supported.

https://github.blog/2021-09-01-improving-git-protocol-security-github/

Fixes #303
2022-04-10 21:11:07 -05:00
Subho Banerjee
aaf5037725
better test case for exit-on-failure 2021-09-12 19:40:37 -05:00
Subho Banerjee
4d2e1537f4
adding a exit on failure flag 2021-09-12 19:34:44 -05:00
Anish Athalye
24f88c4584 Merge branch 'eengstrom/259-link-prefix' 2021-06-02 20:21:40 -04:00
Anish Athalye
74822af9f5 Merge branch 'eengstrom/270-recursive-globbing' 2021-06-02 20:11:25 -04:00
Eric Engstrom
cb6718ba87 test: fix pyenv configuration in vagrant
- addresses change in `pyenv init -` that no longer adjusts PATH.
- also updated testing README.md for readability.

FIXES: #280
2021-06-02 19:47:57 -04:00
Eric Engstrom
6c044208fa
feat: Add prefix: 'string' option to linking when glob: true.
Allows one to store files in a directory or git-repo without the leading 
`.`, as in:

```
dotconf:
├── README.md
├── bin
│   ├── dotbot
│   ├── look
│   ├── pbfile
│   └── ...
├── dot
│   ├── bashrc
│   ├── gitconfig
│   ├── gitignore
│   ├── gorc
│   ├── login
│   ├── ...
│   ├── zshrc
│   └── zshenv
```

Can take a many-line dotbot.yml listing **each** file in `dotconf/dot`,
reducing it to five lines:

```
- link:
    ~/:
      path: dotconf/dot/*
      glob: true
      prefix: '.'
```

FIXES: #259
2021-05-27 12:07:17 -05:00
Eric Engstrom
ab7cbd42dc
feat: Support recursive globbing with **.
For example, will handle an entire directory tree of files, linking all 
files:

```
- link:
    ~/.config/:
      path: dotconf/config/**
      glob: true
```

NOTE, this feature requires newer versions of `glob()` (Python >= 3.5),
and `dotbot` will throw an error if using an earlier version of python.

For testing purposes, added:
  - ability to skip tests in test harness
  - added testing for older Python(s).

FIXES: #270
2021-05-27 11:58:55 -05:00
Eric Engstrom
f56e903cee
Support both [] and ? glob patterns 2021-04-15 23:28:19 -05:00
Anish Athalye
f15293b3d5 Rename 'canonicalize-path' into 'canonicalize'
This parallels 'relative' (it's not 'relative-path'). The old
'canonicalize-path' is still supported for backward compatibility.
2021-02-25 08:26:19 -05:00
Anish Athalye
66489f7955 Fix missing endings of heredocs 2021-02-25 08:16:27 -05:00
Anish Athalye
dac7a9bc88 Add --debug flag to test driver
This is easier than the old method of adding `DEBUG=true` to the top of
test files.
2021-02-25 08:14:34 -05:00
E. Keys
c35382c06d Add cli option force shell show stderr/stdout
Passing `--verbose` flag two times will now force shell commands to show
stderr/stdout output regardless of settings in config file.

Resolves #104
2021-02-25 08:00:07 -05:00
E. Keys
b18ba4d392 Make parsed CLI options available to plugins 2021-02-25 07:57:12 -05:00
Anish Athalye
22ed23c7d9 Merge branch 'etkeys/feature/glob-with-exclude' 2021-02-25 06:59:22 -05:00
E. Keys
6c6fee697e Improve globbing behavior with leading '.' 2021-02-25 06:44:14 -05:00
Anish Athalye
945c1e5a4e Add mode option to create directive
See <https://github.com/anishathalye/dotbot/issues/260>. Thanks to
@eengstrom for the feature suggestion.
2021-02-25 06:25:17 -05:00
Anish Athalye
d7629553bd Switch to GitHub Actions 2020-12-18 15:34:15 -05:00
Anish Athalye
cf366bbf66 Fix interaction between --only and defaults
We should treat defaults specially, and even when `--only` is
specified, we should always run defaults.
2020-11-22 16:58:00 -05:00
E. Keys
2ec7a24129 Add exclude parameter for link globbing
- Added `exclude` parameter to _link_. Now, an array of glob patterns
    can be given that will be used to remove items from a glob match.
    This parameter will only have an effect when `glob` is `true`.
- Updated README to add description for `exclude` and add in examples.

Resolves #247
2020-11-22 14:13:11 -05:00
Anish Athalye
c5e709d433 Make error for empty config a little friendlier
In the setup guide in the README, we have people start out with an empty
file (created using `touch`). Before this patch, Dotbot gave the
following error:

    Configuration file must be a list of tasks

Instead, with this patch, Dotbot says:

    Configuration file is empty, no work to do

This change was prompted by
https://github.com/anishathalye/dotbot/pull/226.
2020-06-25 16:07:23 -04:00
Anish Athalye
7ffaa65482 Add --only and --except command-line arguments
Internal to Dotbot, we use the name "skip" instead of "except", because
the latter is a keyword, and using a name like "except_" didn't seem as
nice.
2020-03-26 11:23:07 -04:00
Anish Athalye
ec8498ffb8 Merge branch 'ypid/add/link_real_path_option' 2020-01-03 16:46:19 -05:00
Anish Athalye
320d5d0123 Add tests for canonicalize-path 2020-01-03 16:45:35 -05:00
Anish Athalye
6d24613b0b Unify Vagrant and Travis-CI tests
This patch makes the tests (including the test driver) run entirely
inside Vagrant, which avoids calling the very slow `vagrant` driver many
times for running the tests. On my machine, `./test` runs in 22 seconds,
down from hundreds of seconds prior to this patch.

This also has the nice side effect of matching how the Travis CI tests
were run, so there's no need for a separate `test_travis` anymore.
2020-01-03 15:34:46 -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
item.

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
Paulo Fagundes
d2913e6cee Replace which with command -v
Some distributions such as Arch Linux no longer install `which` by
default through the base package (see
https://www.archlinux.org/news/base-group-replaced-by-mandatory-base-package-manual-intervention-required/).

The maintainers have explained why `command -v` is superior:
https://www.reddit.com/r/archlinux/comments/de1er6/arch_linux_news_base_group_replaced_by_mandatory/f2v8uhu/.
2019-11-09 12:38:01 -05:00
Anish Athalye
04c113b5b8 Merge branch 'jesseleite/create-directive' 2019-10-12 11:55:18 -04:00
Jesse Leite
5a0f6676d4 Add 'create' directive to create directories 2019-10-12 11:55:09 -04:00
Anish Athalye
32741ea0ca Switch to more recent version of Debian 2019-10-12 10:36:35 -04:00
Anish Athalye
5e2d40939e Merge branch 'thtliife/suppress-shell-cmd' 2018-11-21 19:50:46 -05:00
Anish Athalye
dc05786693 Add test 2018-11-21 19:50:32 -05:00
Anish Athalye
1be9f7532b Add test 2018-11-19 20:38:29 -05:00
Anish Athalye
b0ce63904c Add test for conditional linking 2018-10-16 20:22:50 -04:00
Ben Klein
a9cf9fffe4 Implement conditional linking 2018-10-16 20:22:40 -04:00
Anish Athalye
9332cde5ad Add test for environment variable expansion 2018-08-06 20:53:17 -04:00
Anish Athalye
9d967ad7e8 Include built-in plugins in PyPI distribution 2018-06-11 21:14:10 -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
b5ab016986 Merge branches 'yaml' and 'basedir' 2018-05-29 21:50:08 -04:00
Anish Athalye
7a19cd219a Point PyYAML dependency to official repository
Previously, PyYAML was hosted on BitBucket, so we had a mirror of the
repo on GitHub. Now, official hosting has moved to GitHub, so we can
point to the official repository instead. Thanks to Marco A. Feliu
<marco.feliu@nianet.org> for pointing this out.

This patch also updates the install shim to update submodule URLs. To
preserve the functionality of earlier Dotbot versions, we will need to
maintain 'https://github.com/anishathalye/pyyaml'. Because old versions
of the install shim used with new Dotbot versions will not update
submodule URLs, we will need to keep the old repository in sync with the
upstream repository as we upgrade PyYAML versions.

This patch also upgrades the dependency to PyYAML 3.12.
2018-05-24 19:07:11 -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
Anish Athalye
972e80f188 Fix tests on Travis CI
The tests were failing due to the '~/bin' directory already existing on
the machine. This patch changes the tests to use the directory name
'foo'.
2018-04-13 08:49:02 -04:00
Anish Athalye
8d08e4b1ad Add tests for globbing 2018-04-13 08:49:02 -04:00
Anish Athalye
a517c4c5d0 Fix bug in test harness
Because 'bin/dotbot' is a hybrid sh/Python script that finds the
appropriate Python binary and then runs, the test code should not invoke
it as an sh script when sh does not source the pyenv initialization
script.

The fix implemented in this patch is to directly run 'bin/dotbot' as a
Python script using 'python', which when called from bash, will run with
the correct Python version (because bash is set up to source the pyenv
initialization script).
2018-03-27 21:50:31 -04:00
Anish Athalye
b7022f4abb Speed up Vagrant tests
This patch removes the snapshot/rollback system for the tests and
replaces it with a simple cleanup script that removes the appropriate
files from the VM's $HOME before every test. A side benefit is that
there is no more dependency on the Sahara plugin.

The cleanup script may not provide as good isolation between independent
tests as the previous setup, but it is orders of magnitude faster to run
without a VM rollback for every single test, and it does not break any
of the current tests.
2018-03-27 20:56:55 -04:00
Anish Athalye
9ff1db1672 Change default Python version in tests to 3.6.4 2018-03-27 18:16:55 -04:00