Commit Graph

36 Commits

Author SHA1 Message Date
Trevor Brown
34593c1766 Fix resolution of relative symlinks
Fixes #366, #625
2020-10-08 10:17:01 -04:00
James Hegedus
e9c149ea21
fix: incorrect version output in asdf current (#746) 2020-08-29 09:09:22 +10:00
Trevor Brown
91a2a1f7be Add get_download_path function 2020-03-06 18:54:33 -05:00
Trevor Brown
79ffc55f82 Add another test for asdf_data_dir function 2020-01-31 14:03:33 -05:00
Victor Hugo Borja
83dc1712e3 Change to test HOME on test setup 2019-11-27 12:25:34 -06:00
Trevor Brown
72e876b0ae Handle dashes in executable names properly 2019-10-24 12:05:44 -04:00
Trevor Brown
edb5839239 Rename find_version to find_versions since it can return multiple versions 2019-10-22 19:03:05 -04:00
Trevor Brown
28cf1a74b9 Create function for removing comments from .tool-versions files 2019-03-27 08:50:15 -04: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
54fc0f43dd Add tests for versions set by environment variables
Fixes #327
2018-12-22 15:11:28 -05:00
Trevor Brown
2bc679084f Add test for the resolve_symlink function. 2018-10-07 21:47:57 -04:00
Matt Wean
c468ae7d6a Add another test for the ASDF_DATA_DIR functionality. 2018-09-18 20:21:46 -04:00
Jose Luis Salas
d1782f456e
Retrieve asdf_data_dir from environment variable 2018-09-16 18:39:21 +02:00
Jose Luis Salas
c86707c55f
Add config option to install plugins in $HOME/.asdf 2018-08-11 15:37:56 +02:00
Melissa Xie
f79dda865a Include plugin name in error message if plugin doesn't exist
Previously, if we ran a command like `asdf install` and we encountered a
plugin that didn't exist, asdf produces an error saying "No such
plugin". Without knowing which plugin it could be referring too, we'd
have to manually go through each plugin in `.tool-versions` to find the
culprit.

With this commit, we'll now also include the plugin name as part of the
messaging for easier debugging.
2018-04-30 12:49:40 -04:00
Trevor Brown
4efa8a9707 Fix failing test for ASDF_DEFAULT_TOOL_VERSIONS_FILENAME environment variable. 2018-02-12 18:41:27 -05:00
Trevor Brown
ed3a029e86
Merge branch 'master' into env-config-file-location 2018-02-11 17:31:17 -05:00
DustinChaloupka
05a7446619
Add installing from a parent directory's .tool-versions 2017-10-10 12:02:42 -05:00
Hugo Peixoto
15e59686c4 Add support for $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME
Instead of just looking in $HOME/.tool-versions, allow the default
tool-versions file location to be specified through the variable
$ASDF_TOOL_VERSIONS.
2017-09-25 14:26:14 +01:00
Victor Borja
e75cc3a7a2 Add a test for #224
Allow spaces in .tool_versions file path
See #202, #224
2017-09-03 19:53:01 -05:00
Victor Hugo Borja
242d132afb Find correct installation path for ref: versions
Noticed we had some duplicated logic for finding the
plugins installation path. This caused the bug described
by #213  where the installation command and the find_executable_path
were using different paths.

Fixes #213
2017-07-29 12:47:21 -05:00
Trevor Brown
564b9ed517 Fix tests that were failing due to improved error messages. 2017-03-25 15:16:58 -04:00
Daniel Perez
23f92987c0 Start adding tests for system version 2017-03-17 22:00:38 -04:00
Victor Hugo Borja
873dc5eb3e Merge pull request #110 from vic/get_version_from_env
Get version from env if ASDF_${TOOL}_VERSION is defined.
2017-01-19 11:27:25 -06:00
Victor Borja
85a37ca9a5 Add couple of tests 2016-12-23 11:11:47 -06:00
Victor Borja
f4bc8b58ff Merge remote-tracking branch 'origin/master' into get_version_from_env 2016-12-15 06:28:01 -06:00
Victor Borja
a1bc06fb82 Bugfix: ref: and path: versions are not read correctly.
Before this patch, with a `.tool-versions` file like:

```
lfe ref:master
```

`get_preset_version_for` would return `ref` instead of `ref:master`.

Same was happening for `path:` versions. Actually there was PR #95
on which I based my changes but instead of using space as delimiter
I went for using `|` which would be a lot more weird if present as
part of a file path, this also allows to specify paths which have
spaces which are much more frequent.

Closes #94 #95
2016-12-15 06:12:09 -06:00
Victor Borja
a98185b16a Get version from env if ASDF_${TOOL}_VERSION is defined.
For example if asdf finds that the `ASDF_FOO_VERSION` is
defined in the current environment it will override the
version of `foo` from the `.tool-version` file.

Closes #49
2016-12-15 06:10:25 -06:00
Victor Borja
26532e7914 Determine version from global setting when project is outside home.
Without this patch, asft was not able to determine the tool version
for a project located outside the user's HOME directory.

```
/work/project/
/home/me/.tool-versions
```

This changeset lets asdf find the global version stored at
$HOME/.tool-versions when the directory traversal from
the project dir was not able to find a suitable version.
2016-10-29 06:08:54 -05:00
Kevin Rockwood
d505c0ee71 Return both version and path from find_version
This allows the current command to print the setting file.
2016-08-30 09:21:26 +09:00
Kevin Rockwood
cec4e9a737 Combine search and parse operations
We need to search and parse simultaneously in case the tool-versions 
file doesn't contain a setter line for the plugin.
2016-08-28 13:41:37 +09:00
Kevin Rockwood
c6d814e247 Unify .tool-versions and legacy file search 2016-08-14 09:10:24 +09:00
Kevin Rockwood
16f3fa9f03 Use dummy plugin for utils test 2016-08-14 09:10:24 +09:00
Laurens Duijvesteijn
337b335c4d Check if plugin exists before removing it (#77)
Check if plugin exists before removing it
2016-07-06 08:19:15 +09:00
Daniel Perez
3af5d21067 Set ASDF_CONCURRENCY when installing 2016-07-01 16:42:59 +09:00
Daniel Perez
784d7e9f34 Add support for local and global commands. 2016-04-25 02:13:09 +09:00