Commit Graph

31 Commits

Author SHA1 Message Date
Alberto de Murga
9430a39aef
feat: Displays a warning when a plugin from the tools-version list does not exist (#1033)
* feat: Displays a warning when the plugin from the tools-version does not exist

When calling the install command, it tried to look for versions for all
the plugins available and installed them. With this change, it will attempt to
find versions for all the installed plugins and plugins defined in the
`.tool-versions`.

Fixes https://github.com/asdf-vm/asdf/issues/574

* feat: Changes the algorithm to detect not installed plugins

This patch changes the algorithm. It preserves the original logic for
the plugin resolution, but at the same time, reports entries with plugins not
available.

* fix: Addresses the pull request comments.

- Changes the comparison to be strict rather than partial.
- Prints a list of missing plugins.
- Exists if at least one plugin is not present.
- Adds unit tests.
2021-10-01 08:38:57 -04:00
Matt
a7d3661f6c
fix: insert error handling in list-all & download plugin scripts (#881) 2021-05-19 19:51:45 +10:00
Jochen Schalanda
0edb50547c
feat: support for "latest" in shell, local, and global (#802) 2020-09-19 15:37:52 +10:00
Dan Fuchs
d7e1e66c03 Add test for invalid asdf install arguments 2020-07-09 21:18:16 -05:00
Dan Fuchs
6a1855e26f Install one tool specified in .tool-versions
`asdf install <name>` installs that single tool at the version specified
in `.tool-versions`.  If there is no `.tool-versions` or if that tool is
not in it, an error message is shown and `asdf` exits `1`.

Implements #759
2020-07-09 18:16:50 -05:00
Trevor Brown
309a4f1a12 Don't delete the download directory if the --keep-download flag is passed or the always_keep_download config is set to yes 2020-05-04 15:05:10 -04:00
Trevor Brown
5c6f24f1ce Add basic tests for legacy plugins 2020-05-04 11:18:31 -04:00
Kevin Lane
c11409583f
Add unit tests for managing latest stable versions 2019-11-22 10:37:53 -08:00
Trevor Brown
cea9b9574f Install multiple versions when multiple versions are present in a .tool-versions file 2019-10-22 18:58:30 -04:00
Trevor Brown
3516c08c6b Fix failing test 2019-06-17 20:38:17 -04:00
Leonid Shevtsov
d506aa183a tests for install command:
- remove test for install command edge case from parsing tool-versions (no longer relevant)
- add test for install command honoring legacy version files
- clean up test names to differentiate between installing a single version vs all dependencies
2019-06-01 07:48:17 +03:00
Trevor Brown
1a4a9435f3 Make install command ignore comments 2019-03-27 08:50:15 -04:00
Victor Hugo Borja
9cac0ac50a Faster exec times. Load commands only when nedded.
When testing, use `run asdf` to actually test the command
as the user would invoke it, so that we might catch possible
errors on `bin/asdf`.
2019-01-20 02:13:20 -06:00
Victor Hugo Borja
dcc3727cab Add pre-install and pre-reshim hooks 2019-01-19 13:32:07 -06:00
Victor Hugo Borja
9a79ac9526 user configurable pre-post command hooks
Suppose a `foo` plugin is installed and provides a `bar` executable.
The following hooks will be executed when set in `.asdfrc`:

```shell
post_asdf_install_foo = echo installed foo version ${1}
post_asdf_reshim_foo = echo reshimmed foo version ${1}

pre_foo_bar = echo about to execute command bar from foo with args: ${@}
post_foo_bar = echo just executed command bar from foo with args: ${@}
```
2019-01-19 13:32:07 -06:00
Victor Hugo Borja
9b27848d07 New shim metadata to allow many plugins with same executable names
Features

* New shim version meta-data allows shims to not depend on a particular plugin
  nor on its relative executable path (#431)
  Upgrading requires shim re-generation and should happen automatically
  by `asdf-exec`:
    `rm -rf ~/.asdf/shims/` followed by `asdf reshim`
* Added lots of tests for shim execution.
  We now make sure that shim execution obeys plugins hooks like
  `list-bin-paths` and `exec-path`.
* Shim exec is now performed by a new `bin/private/asdf-tool-exec` that might
  be faster for most common use case: (versions on local .tool-versions file)
  but fallbacks to slower `get_preset_version_for` which takes legacy formats
  into account.
* Shim exec recommends which plugins or versions to set when command is
  not found.

Fixed Bugs

* Allow many plugins to provide shims with same executable name (#431)
2019-01-19 13:22:12 -06:00
Trevor Brown
22b709f94e
Merge pull request #403 from burnettk/support-tool-versions-without-newline
support .tool-versions content even if it does not end in a newline
2018-11-20 09:18:41 -05:00
Kevin Burnett
f1b2c59b1d support .tool-versions if it does not end in newline 2018-11-15 21:47:48 -05:00
Trevor Brown
39687b5a94 Add test for not installing system versions. 2018-10-07 14:31:30 -04:00
Diego Nogueira Teixeira
20bb61963d Implemented tests for shim generation only for executable files, not directories. 2018-09-19 09:00:11 -03:00
DustinChaloupka
05a7446619
Add installing from a parent directory's .tool-versions 2017-10-10 12:02:42 -05:00
Victor Borja
5398d8949c Fix sed invocations for OSX 2017-09-03 20:23:06 -05:00
Daniel Perez
5a270d4cb4 Add asdf-plugin-version metadata to shims
This adds `asdf-plugin-version` to all generated shims.
This metadata is used to remove the shim when necessary.
2017-07-27 01:26:38 +02:00
Stratus3D
7c28074423 Add a helpful error message to the install command to warn users when they don't specify a version to install. 2016-12-18 12:52:23 -05:00
Victor Borja
eecd1f36d1 Test produced shims by actually running them.
Test using a dummy executable.

Closes #127
2016-12-13 13:32:49 -06:00
Victor Borja
1c99863e56 Add documentation on metadata for shim authors 2016-12-10 14:05:23 -06:00
Victor Borja
c7d21bfb2c Test shims executable 2016-12-10 12:22:36 -06:00
Victor Borja
7512d9abf4 Add metadata to shims
When a shim is created, add plugin metadata so we can later know which shims belong to which plugins, this will help aid with removing unused shims on uninstall. See #67

```
# asdf-plugin: ${plugin_name}”
```

Thanks to @duijf for the metadata proposal.
2016-12-10 12:17:50 -06:00
Stratus3D
20ef5321e1 Update the install_command function so it works when invoked in directory whose name contains whitespace. 2016-10-25 21:45:17 -04:00
Stratus3D
8bc937689c Add test for the install command in a directory name containing whitespace. 2016-10-25 18:11:36 -04:00
Daniel Perez
3af5d21067 Set ASDF_CONCURRENCY when installing 2016-07-01 16:42:59 +09:00