Commit Graph

507 Commits

Author SHA1 Message Date
Trevor Brown
bc1d9cb2c2
Merge pull request #497 from asdf-vm/rc-releases
Add support for RC releases
2019-03-25 08:19:30 -04:00
Trevor Brown
85057b6969 Add support for RC versions to asdf update command 2019-03-24 18:24:19 -04:00
Daniel Perez
81709db18a Fix shim_plugin_version 2019-03-23 21:21:55 +00:00
Trevor Brown
02f24df5e8 Improve output of where command when system version is set 2019-03-23 10:45:50 -04:00
Daniel Perez
1d43a052fe
Merge pull request #480 from jonmast/add-shell-command
Add "shell" subcommand for setting versions in shell session
2019-03-20 19:02:59 +00:00
Daniel Perez
0f0bbef50d Fix select version when multiple versions available
With the previous version, the following case would fail.
It would use python 2.7.15 when running pip
instead of version 3.7.2.

Shim for `pip`

```bash
exec /home/daniel/.asdf/bin/asdf exec "pip" "$@"
```

`.tool-versions`:

```
python 3.7.2 2.7.15 system
```
2019-03-20 17:20:01 +00:00
Daniel Perez
c06799cfca Fix legacy version and multi versions handling 2019-03-16 19:45:37 +00:00
Jonathan Mast
9116e8453d
Add "shell" subcommand for setting versions in shell session
Add a "shell" command similar to the existing "global" and "local"
commands, which sets the version in an environment variable instead of
writing it to a file. This was inspired by the similar functionality in
rbenv.

It works by adding a wrapper function for the asdf command. It forwards
to a "sh-shell" command that returns the exports as shell code which is
then evaled by the wrapper. This is a little gross, but we need to run
the code in the shell context in order to set variables.

Resolves #378
2019-03-09 13:19:33 -05:00
Trevor Brown
ba42343f92
Merge pull request #474 from asdf-vm/update-fix
Use asdf_dir instead of $ASDF_DIR
2019-03-01 15:09:46 -05:00
Trevor Brown
a60b28e716 Use asdf_dir instead of $ASDF_DIR 2019-02-28 22:55:50 -05:00
Victor Hugo Borja
cdd8dc105a fix shellchecks 2019-01-23 22:27:31 -06:00
Victor Hugo Borja
4b40e80776 Test that command being executed can see other tools shims on path 2019-01-23 22:18:18 -06:00
Victor Hugo Borja
8ccfda26b8 Prevent warning about global ASDF_DIR being undefined. 2019-01-21 22:45:32 -06:00
Victor Hugo Borja
0260c442cc Test to ensure asdf exec and asdf env use plugin custom exec-env 2019-01-21 01:33:52 -06:00
Victor Hugo Borja
ab59e5618f Move common functionality to utils.sh
- Make shim-exec, shim-env, and which use the same logic to look for commands
- Make sure shim-exec and which use a plugin exec-path hook as documented
  (the hook takes a relative path to the executable and returns also
   a relative path, possibly modified)
- Fix shellchecks
2019-01-20 14:02:22 -06: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
8927a4a09f Add asdf env command 2019-01-19 20:59:27 -06:00
Victor Hugo Borja
89775c8d88 fix lint on shim-exec 2019-01-19 20:25:41 -06:00
Victor Hugo Borja
e51f778b61 Move bin/private/asdf-tool-exec to be asdf exec command
This way the code for executing shims can also be invoked via
`asdf exec <tool> [args..]` and can be linted.
2019-01-19 20:02:14 -06:00
Victor Hugo Borja
a46eaf3b4a Merge remote-tracking branch 'origin/shim-versions-command' into 0.6.4-dev 2019-01-19 13:56:56 -06:00
Victor Hugo Borja
9420ca1aec Add hooks for plugin uninstall 2019-01-19 13:48:21 -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
7fda291df0 Add asdf shim-versions command (#380)
For example `asdf shim-versions npm` will list the plugins and their
versions on which the `npm` command is available.

Based on #432
2019-01-19 13:31:26 -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
8f242e7ec2 Address shellcheck warnings 2019-01-05 11:10:59 -05:00
Trevor Brown
c37307a2cc Create get_custom_executable_path function to hold the custom exec path logic 2019-01-05 10:23:41 -05:00
Raphx
ec6662d4c0
Continue list even when version is not found
Previous implementation exits abruptly when no version is installed for
a plugin. This prevented the list command from listing the versions for
some other plugins.

This commit allows list command to continue executing even when no
version is installed for some plugins.

Example, plugin a with 1.0, b with none, and c with 2.0.

Previous implementation:

```
$ asdf list

a
  1.0
b
No versions installed
```

After commit changes:

```
$ asdf list

a
  1.0
b
No versions installed
c
  2.0
```
2018-12-28 09:21:43 +08:00
Trevor Brown
fcf5f3653c
Merge pull request #416 from asdf-vm/fix-shellcheck-warnings
Fix shellcheck warnings on OSX
2018-12-21 17:34:37 -05:00
Trevor Brown
41e2059a3e Fix shellcheck warnings on OSX 2018-12-20 17:25:30 -05:00
Trevor Brown
7ca88746a8
Merge pull request #411 from rliebz/update
Fix issues with update command
2018-12-02 14:12:23 -05:00
Robert Liebowitz
321e3b0e46 Exit 1 for failed update 2018-12-01 21:17:27 -05:00
Robert Liebowitz
697772fe8c Fix git dir for update and add error handling 2018-12-01 21:07:44 -05:00
Daniel Perez
2eae89c432 Fix which for when "system" version is present 2018-11-29 00:31:31 +00:00
Daniel Perez
11882c1151
Merge pull request #382 from fcrespo82/better-which-command
Updated which command.
2018-11-29 00:18:51 +00:00
Trevor Brown
f88f140ea8
Make get_executable_path use ASDF_DATA_DIR
Fixes #402
2018-11-26 08:50:11 -05:00
Fernando Crespo
0871b7fe8f Change maxdepth position to fix error in ubuntu trusty 2018-11-21 14:57:05 -02: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
Fernando Crespo
03394831a8 Merge remote-tracking branch 'upstream/master' into better-which-command 2018-11-12 15:35:19 -02:00
Fernando Crespo
3491322601 Fixed review issues and added -L to find to account for python having its main binary as a symlink 2018-11-12 15:30:44 -02:00
Daniel Perez
18587d4d6f Fix current behavior when multiple versions of a plugin are set 2018-11-10 11:32:02 +00:00
Trevor Brown
359191104b
Merge pull request #389 from mig4/where-default-version-to-current
Make where command default to current version
2018-11-03 10:07:44 -04:00
mig4
a58e9e3c17
Make where command default to current version
Allow not specifying the version on command line in which case fall back
to looking it up.

Also add tests for the `where` command.
2018-10-28 17:47:21 +00:00
mig4
f994b07a2c
Optimise listing all plugins
When checking if a plugin is installed (to display a flag) it is not
necessary to loop through all installed plugins, since we already have
a name we can check directly.

Also expand test case to test this code path too.
2018-10-27 20:05:02 +01:00
Fernando Crespo
61b288c959 Fix shellcheck lint errors 2018-10-21 00:56:28 -03:00
Fernando Crespo
46e5f7427f Updated which command.
Should fix #205
2018-10-21 00:47:13 -03:00
Trevor Brown
357413c950 Add support for the --asdf-tool-version flag to the plugin-test command. 2018-10-20 11:48:10 -04:00
Trevor Brown
13cff01ea0 Fix output for plugin_test_command function. 2018-10-19 22:46:51 -04:00
Trevor Brown
fc078c5e72 Implement 'asdf local -p'. 2018-10-19 20:41:49 -04:00
Trevor Brown
f708e3c15f
Merge pull request #371 from phunehehe/version-set-by
commands/current: add space before parenthesis
2018-10-10 18:21:46 -04:00
Hoang Xuan Phu
1330083229 commands/current: add space before parenthesis
It seems to have been lost in 88d47bbd69.
Probably by accident?

I also pulled the literal bits into the format string. It looks more
readable to me that way. I'm happy to remove that if it's not desired.
2018-10-10 17:28:23 -04:00
Trevor Brown
d6b01e35ec Simplify resolve_symlink function. 2018-10-07 21:47:57 -04:00
Trevor Brown
e0cdec39f9 Address shellcheck errors in resolve_symlink function. 2018-10-07 21:47:57 -04:00
Trevor Brown
4c4590c6e6 Update resolve_symlink function so it always returns absolute paths. 2018-10-07 21:47:57 -04:00
Trevor Brown
e095ed5efa Don't install system versions. 2018-10-07 14:35:36 -04:00
Jose Luis Salas
448d3215d8
Fix asdf current behaviour
Closes: #353
2018-10-04 21:00:29 +02:00
Jose Luis Salas
5acef7c9bf
Remove get_install_type and fix indentation 2018-09-27 22:18:36 +02:00
Diego Nogueira Teixeira
28c0576d17 Fix reshim to create shim only for executable files and not directories. 2018-09-18 10:38:22 -03:00
Trevor Brown
2e27ceb090
Merge pull request #335 from josacar/user-install-directory
Install data outside asdf installation directory
2018-09-16 22:36:08 -04:00
Jose Luis Salas
d1782f456e
Retrieve asdf_data_dir from environment variable 2018-09-16 18:39:21 +02:00
Victor Hugo Borja
a4fc43e682 plugin-test: check Auth is used when list-all uses Github API
Many plugins were having this problem where they rely on accessing
GitHub's API for listing versions from some repo releases. But not
setting an Authorization token for `curl`, causes the test to fail.

We now detect that if the plugin `list-all` looks like accessing
`api.github.com` and if so, we also try to guess if the Authroization
header will be set. If not, we fail the test and head the plugin author
to some documentation on how to add it.

Hope this reduces the number of failures due to GitHub API rate
limiting on travis.
2018-08-29 23:19:30 -07:00
Victor Hugo Borja
950853d9e6 test plugin in subshell and from isolated asdf
The subshell sources the isolated asdf environment, making the asdf
command available. In some plugin tests we were having failures do
to the asdf bin not set on PATH.
2018-08-29 23:16:01 -07:00
Jose Luis Salas
c86707c55f
Add config option to install plugins in $HOME/.asdf 2018-08-11 15:37:56 +02:00
Trevor Brown
bcdc5e0ba7 Switch to single quotes for sed regex. 2018-06-17 19:31:36 -04:00
Trevor Brown
001cd6022f Ignore shellcheck warning. 2018-06-16 23:07:17 -04:00
Trevor Brown
631ad8a005 Resolve symlink paths before altering .tool-version files. 2018-06-16 22:59:37 -04:00
Trevor Brown
c1ce9de4d4
Merge pull request #331 from brennanfee/fix-330-asdf-list
Fix for #330 - "asdf list" spacing
2018-06-16 15:30:35 -04:00
Trevor Brown
1b44fa7549 Fix shellcheck warnings. 2018-06-16 15:26:02 -04:00
Brennan Fee
8a018715c7
Fix for #330 - "asdf list" spacing
In order to make the output of "asdf list" a bit easier to read, this commit adds two spaces to the front of each version being written so as to indent them under the plugin.
2018-05-31 11:45:20 -05:00
Brennan Fee
4cb89b152c
Fix another spot for plugin-name env var lookup
After fixing #319 I wondered if there were any other spots where the same/similar bug existed.  I found one other location at line 126 in utils.sh.
2018-05-31 10:46:04 -05:00
Brennan Fee
67bc9539d1 Fix for #319
Fixed #319 by forcing all dashes to underscores in the plugin name.
Shell variables don't allow dash.
2018-05-30 20:02:23 -05:00
Michael Davis
3f51d3a5ab Change exit code from 0 -> 2 2018-05-29 21:47:46 -05:00
Michael Davis
c4a2ffb356 Make exit code of an already installed plugin 0
When plugin-add is called on a plugin that's already installed, asdf
will return 0.
2018-05-25 13:26:48 -05: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
hlhr
e1a4ff244f list command without parameter lists all packages with versions 2018-04-16 18:37:22 -04:00
Edoardo Tenani
23bf434dbf use exit code 126 when version is not set 2018-04-05 23:59:31 +02:00
Neil Martinsen-Burrell
c7a8226db5 Print to stderr one level up to make tests pass 2018-03-30 12:09:56 -05:00
Neil Martinsen-Burrell
c1e50c2894 Print "No version set" message to stderr 2018-03-30 11:15:53 -05:00
james.bunch
d62fa098c1 AZDF -> ASDF environment variable name spelling
change all instances of `AZDF` to read `ASDF` instead, to bring the
variable names in line with the project name
2018-02-27 11:56:04 -08:00
AJ Foster
a195da28c2 Promote which version check from subshell to enable error emission 2018-02-25 18:34:39 -05:00
AJ Foster
eb5e5b780c Refactor "no version set" message to utilities 2018-02-25 18:33:42 -05:00
Trevor Brown
9733daafd4
Merge pull request #293 from aj-foster/no-version-errors
Suggest action when no version is set
2018-02-25 13:17:20 -05:00
AJ Foster
24a7190505 Specify when a version is set via environment variable 2018-02-25 01:11:16 -05:00
AJ Foster
c2fb6a3140 Escape backticks in command suggestion 2018-02-25 00:50:46 -05:00
AJ Foster
f15a0c9de3 Suggest action when no version is set 2018-02-25 00:40:26 -05: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
Trevor Brown
0f48c1861b Remove unnecessary regex from replacement string in regex command. 2018-02-11 15:12:31 -05:00
jthegedus
8374c227fc add --urls flag for asdf list-plugins
Fixed tests due to use of printf
2018-02-11 15:04:06 -05:00
jthegedus
afac39f1fd Fix asdf current - and it was at this point I realised 2018-02-11 15:04:06 -05:00
jthegedus
b738413949 add indicator if installed on asdf plugin-list-all 2018-02-11 15:04:06 -05:00
jthegedus
c6bc978c26 add escape for \n where necessary 2018-02-11 15:04:06 -05:00
jthegedus
5d523a5b50 Add print repo URLs with asdf plugin-list and adsf plugin-list-all
* Use printf for formatting
* Add error when plugin index at /asdf_dir/repository/plugins is not found
* add example of output to README
2018-02-11 15:04:06 -05:00
Trevor Brown
ee082dc6ee Address warnings reported by new version of shellcheck. 2018-02-11 15:04:05 -05:00
Mark Villacampa
025bd995d5 add two more cases where we need to specify bening and end of line in the .tool-versions to properly identify plugin names 2017-12-16 02:05:52 +01:00
Mark Villacampa
77ce346578 grep for plugin_name from begining of line 2017-12-15 22:36:24 +01:00
Trevor Brown
8794210b8e Add 'eval' to list of banned commands. 2017-11-16 22:43:52 -05:00
William Ashton
43fd8c978d Tell sed to create backup files, and the remove them
This seems like the easiest way forward, considering the incompatability between the LInux and MacOS versions of sed.
2017-10-27 10:27:27 -04:00
William Ashton
dc3865c9fd Prevent sed from creating -e backup files. Fixes #242 2017-10-26 15:58:45 -04:00
Shunsuke Kirino
9ba0a5cc2d Replace ref- prefix in output of list command with ref: 2017-10-23 11:23:51 +09:00
Daniel Perez
e2094db465 Merge pull request #237 from DustinChaloupka/install-parent-tool-versions
Add installing from a parent directory's .tool-versions
2017-10-17 23:28:37 +09:00
Trevor Brown
2171f48f0f Merge pull request #231 from hugopeixoto/use-origin-when-updating-tags
Use origin when updating tags
2017-10-14 17:23:16 +03:00
DustinChaloupka
320835ba7e
Declare and assign variable separately 2017-10-10 13:31:15 -05:00
DustinChaloupka
05a7446619
Add installing from a parent directory's .tool-versions 2017-10-10 12:02:42 -05:00
Jonathan Knapp
85550c8c0c
Remove extra, unnecessary quoting 2017-10-02 09:51:07 -04:00
Jonathan Knapp
20b70bccc7
Remove shebangs from lib files and pass bash dialect to shellcheck 2017-10-01 11:34:35 -04:00
Jonathan Knapp
33d7d9c26c
Merge remote-tracking branch 'source/master' into origin/shellcheck 2017-10-01 09:15:22 -04: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
Hugo Peixoto
9e97bc5e61 Use origin when updating tags 2017-09-25 14:13:35 +01:00
Trevor Brown
84ad80f575 Add mechanism to disable the update command since it will not work when asdf is installed via brew. 2017-09-12 18:48:00 -04:00
Trevor Brown
4da62b16c8 Move hardcoded version to VERSION file in repo root. 2017-09-12 18:48:00 -04:00
Trevor Brown
663ebb9a2f Move asdf_repository_url function to top of utils.sh. 2017-09-06 21:37:08 -04:00
Victor Borja
8b40b30dec let bin/asdf expand args into command functions 2017-09-04 12:49:38 -05:00
Victor Borja
e814d58da3 Shellcheck all commands 2017-09-04 12:04:56 -05:00
Jonathan Knapp
9d6ddb71d5
Fix linter errors 2017-09-04 10:12:45 -04:00
Jonathan Knapp
f75e988363
Fix another linter error that did not trigger on osx 2017-09-04 10:11:06 -04:00
Jonathan Knapp
91d52b99cb
Run shellcheck on lib/utils.sh 2017-09-04 10:11:06 -04:00
Jonathan Knapp
808a8d48b7
Fix many shellcheck issues; ignore a few others 2017-09-04 10:09:47 -04:00
Victor Borja
e74c472829 Test current command with no installed version 2017-09-03 22:20:35 -05:00
vic
779e757b56 Merge pull request #212 from asdf-vm/asdf-plugin-version
Add asdf-plugin-version metadata to shims
2017-09-03 20:26:27 -05:00
Victor Borja
5398d8949c Fix sed invocations for OSX 2017-09-03 20:23:06 -05:00
Victor Borja
f23b448c0c Merge remote-tracking branch 'origin/master' into asdf-plugin-version 2017-09-03 20:01:27 -05:00
vic
28d7921777 Merge pull request #221 from asdf-vm/plugin-list-all
Add plugin-list-all command
2017-09-03 20:00:02 -05:00
AJ Foster
e3e247752c Allow spaces in .tool_versions file path
This helps to address (though may not completely fix) issue #202.
2017-09-02 23:05:40 -04:00
Daniel Perez
b9fae70c0d Add plugin-list-all command 2017-08-25 11:29:23 +09:00
Daniel Perez
8af4b3377c List all installed plugins when no argument is passed to current 2017-08-19 13:56:28 +09:00
Daniel Perez
4a9d268710 Fix regression in install command 2017-07-30 20:15:21 +02:00
Daniel Perez
1499bda7b3 Trap sigint when installing plugins, fix #214 2017-07-30 20:02:19 +02: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
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
Daniel Perez
78fbbaf584 Merge pull request #183 from doughsay/master
Use a git repository for installing plugins.
2017-07-26 18:49:15 +02:00
Chris Dosé
a0e5573960
Update plugins repo url. 2017-07-26 09:20:05 -07:00
Fernando
1e9166e9bc Merge branch 'master' into which_command 2017-05-15 15:40:42 -03:00
Daniel Perez
82f399c6b3 Merge pull request #164 from ypid/docs_improvements
Docs improvements
2017-05-15 11:17:25 +09:00
Chris Dosé
5255f0e664 a little too zealous on the shellcheck warnings. 2017-04-19 20:40:06 -07:00
Chris Dosé
f399254219 code review feedback: fix all shellcheck warnings. 2017-04-19 20:37:03 -07:00
Chris Dosé
96c24e9255 code review feedback: git reset instead of git pull 2017-04-19 20:26:33 -07:00
William Ashton
baad7dd6d4 Query git for the current tag
Fixes #189
2017-04-15 22:50:43 -04:00
Henrik Nyh
d7ceb38b06 Avoid bash error when no version is set
Running "asdf current ruby" before installing any Rubies gave me:

    /Users/henrik/.asdf/lib/utils.sh: line 73: [: !=: unary operator expected
    No version set for ruby
2017-04-08 09:38:18 +01:00
Trevor Brown
974597ddc7 Correct sed command that removes asdf from PATH. 2017-03-27 11:04:52 -04:00
Chris Dosé
20cdbfe701
Use a git repository for installing plugins. 2017-03-26 16:44:22 -07:00
Trevor Brown
0f7757a910 Correct if statements in asdf-exec and utils.sh. 2017-03-25 14:50:30 -04:00
Daniel Perez
23f92987c0 Start adding tests for system version 2017-03-17 22:00:38 -04:00
Daniel Perez
f5152f255a WIP: support system version 2017-03-17 22:00:37 -04:00
Trevor Brown
2ca517d8c1 Add tests for the update command. Use sed instead of tail -r to get the
latest tag from the list of sorted tags.

The setup code for these tests isn't ideal. It would be nice not to have
to worry about the remote. Without the 'origin' remote set the Travis
build would fail though.
2017-03-17 21:19:46 -04:00
Trevor Brown
8534ca2858 Finish the update command. 2017-03-17 13:07:30 -04:00
Trevor Brown
492ea04cc0 Add update command. 2017-03-17 13:07:30 -04:00
Fernando Crespo
2260d22d79 Add missing function checking for deprecated plugins 2017-03-16 00:57:07 -03:00
Akash Manohar
7c2514d93b Merge pull request #171 from asdf-vm/test-for-plugin-license
Update the plugin-test command to assert that the plugin license file exists
2017-03-16 06:50:30 +05:30
Fernando Crespo
9657ff690e Add path to which command 2017-03-14 11:09:34 -03:00
Fernando Crespo
9d347deb0b Add plugin name to command 2017-03-14 11:08:18 -03:00
Fernando Crespo
3e72800052 add parameter to current version 2017-03-14 11:07:22 -03:00
Fernando Crespo
1ea63ec257 Fix extra paren 2017-03-14 11:06:07 -03:00
Fernando Crespo
5ccb7d75f5 Fix no install_type 2017-03-14 11:04:30 -03:00
Fernando Crespo
fb4e263598 Initial support for which command 2017-03-14 10:56:59 -03:00
Bjørn Madsen
887de73b79 Avoid error when sysctl is missing hw.ncpu key 2017-03-13 09:13:42 +01:00
Trevor Brown
3c449deb97 Update the plugin-test command to assert that the plugin license file exists and is not empty. 2017-03-07 17:33:41 -05:00
Trevor Brown
e6c69d4676 Make sure grep uses the correct settings when invoked by asdf. 2017-03-07 13:18:20 -05:00
Robin Schneider
7c30e6f9d2
Fix typo: seperated → separated
Automated edit command: git ls-files -z "$(git rev-parse --show-toplevel)" | xargs --null -I '{}' find '{}' -type f -print0 | xargs --null sed --in-place --regexp-extended 's/seperated/separated/g;'
2017-02-20 19:44:44 +01:00
Trevor Brown
85e56753fd Don't change the permissions on files in a plugin's bin directory. 2017-02-11 20:46:34 -05: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 Hugo Borja
8709d197f1 Merge pull request #137 from vic/set-path-version
Allow `asdf local` and `asdf global` to take path: versions
2017-01-19 11:27:06 -06:00
Trevor Brown
9ac1df50aa Merge pull request #138 from Stratus3D/check-plugin-permissions
Check permissions on scripts in plugins' bin directories when testing
2016-12-27 08:10:37 -07:00
Trevor Brown
2e96bc63eb Merge branch 'release-v0.2.1' 2016-12-25 12:14:09 -05:00
Trevor Brown
dff1149fb5 Check permissions on scripts in plugins' bin directories when testing them. 2016-12-21 20:58:11 -05:00
Trevor Brown
5f3ff8ec26 Update the version in the README and utils.sh. 2016-12-21 18:45:57 -05:00
Victor Borja
716d8a93cd Allow asdf local and asdf global to take path: versions
When given a path: version, just check that the directory
actually exists.
2016-12-19 00:25:29 -06: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
Trevor Brown
127f926391 Merge pull request #123 from vic/shims-remove
Shims remove on latest version uninstall (depends on #122).
2016-12-16 15:47:24 -07: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
d1f0b64c2f Remove shims on uninstall or plugin-remove
- Remove plugin shims when last version is uninstalled.
- Remove shims on plugin-remove

When the latest version of a tool is uninstalled,
Remove the plugin shims (marked with metadata at #122)

Also found lots of missing tests and added them.

Closes #67
2016-12-15 06:05:23 -06:00
Victor Borja
6ddf1e5e49 Fix shim args again.
Broken here:

00bf082b31 (diff-774f80a035a812fafdd48ebc7c8b6af4R54)

but this time we have tests to notice:

https://travis-ci.org/asdf-vm/asdf/builds/184202823
2016-12-15 05:34:35 -06:00
Tadeu Andrade
6d78d4fd80 Reverting slash on quotes 2016-12-13 10:03:28 -03:00
mtatheonly
e04fe9ed54 Update reshim.sh
Removing unneeded slash from shim writing.
2016-12-12 18:54:52 -03: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
DalHo Park
d46d6ca6df Merge branch 'master' of https://github.com/asdf-vm/asdf 2016-11-05 15:39:08 +09: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
DalHo Park
8e59d8de98 file_path may have some spaces. 2016-10-27 16:24:34 +09: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
Daniel Perez
95bde8e86f Fix local and global commands to accept multiple versions 2016-08-30 19:13:10 -04:00
Stratus3D
12a6316e4c Fix whitespace bug in 'asdf local'. 2016-08-30 19:13:10 -04: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
280581c566 Clean up utils
Whitespace and remove dead function
2016-08-14 09:10:24 +09:00
Kevin Rockwood
511535b750 Add warning to when using deprecated plugins
This can be removed after we've given users enough time to update.
2016-08-14 09:10:24 +09:00
Kevin Rockwood
4d75ddd50b Update current command with new util functions
current will now print paths to legacy files and .tool-version files
2016-08-14 09:10:24 +09:00
Kevin Rockwood
c6d814e247 Unify .tool-versions and legacy file search 2016-08-14 09:10:24 +09:00
Trevor Brown
cf184ce453 Add -dev suffix to version currently in development (0.2.0). 2016-08-04 19:11:26 -04:00
Trevor Brown
c77fa1ab77 Update version in utils.sh. Next release will be 0.2.0. 2016-07-29 19:56:40 -04:00
Kevin Rockwood
7517aa3abc Remove getter feature on local and global commands
This simplifies the `local` and `global` commands. `asdf current` should
be sufficient for getting the current version.

closes #80
2016-07-25 09:44:53 +09:00
Kevin Rockwood
ca1273e7d4 Rename which to current (#79)
* Rename `asdf which` -> `asdf current`

* Output `set by $path` with current command

* Use dummy plugin in current_command test

* Hide "set by" message if derived from legacy file
2016-07-25 00:47:17 +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
Laurens Duijvesteijn
ccefa996dc plugin-update: argument validation 2016-07-03 13:15:57 +02:00
Laurens Duijvesteijn
f9572739f6 plugin-add: argument validation 2016-07-03 13:11:40 +02:00
Daniel Perez
a8f67c9821 Fix issue in install get_concurrency 2016-07-01 18:26:25 +09:00
Daniel Perez
3af5d21067 Set ASDF_CONCURRENCY when installing 2016-07-01 16:42:59 +09:00
Daniel Perez
caee08d39b Improve plugin tests 2016-06-17 18:37:26 +09:00
Akash Manohar
c3765182f8 Merge pull request #51 from tuvistavie/use-multiple-versions
Make it possible to use fallback versions. Thank you @tuvistavie ~!
2016-05-14 15:19:29 +05:30
Akash Manohar
9c74973f8b Merge pull request #54 from tuvistavie/plugin-test
Add command and instructions to test plugin. Thank you @tuvistavie ~!
2016-05-14 10:07:17 +05:30
Daniel Perez
61e014a2d6 Fix local command bug. 2016-05-14 11:11:16 +09:00
Daniel Perez
072a57e4cb Add command and instructions to test plugin. 2016-05-13 16:04:01 +09:00
Daniel Perez
3e31c40020 Make it possible to use fallback versions. 2016-05-04 02:22:48 +09:00
Daniel Perez
b0513a6da0 Fix local command to support legacy files. 2016-05-03 00:27:52 +09:00
Akash Manohar J
5739dd723a Check if legacy versions are enabled before using them 2016-04-25 05:02:18 +05:30
Akash Manohar J
18ed5c106a Merge latest master 2016-04-25 04:48:12 +05:30
Daniel Perez
784d7e9f34 Add support for local and global commands. 2016-04-25 02:13:09 +09:00
Daniel Perez
d4ee3aa999 Add support for config file. 2016-04-24 22:39:24 +09:00
Trevor Brown
dcfa52e2ca Correct if statement in get_tool_version_from_legacy_file function. 2016-02-13 14:10:58 -05:00
Trevor Brown
2e17f9eb03 Reorder variables the get_tool_version_from_legacy_file function. 2016-02-13 10:32:35 -05:00
Trevor Brown
9080ff2e33 Fix bug in get_preset_version_for function. Refactor the get_tool_version_from_legacy_file function. 2016-02-13 10:30:34 -05:00
Akash Manohar J
d217514081 Fix loop bug during install with blank line in .tool-versions 2016-01-17 08:00:53 +05:30
William Ashton
f4f35be9d6 Fixes #26 2015-12-22 19:00:18 -05:00
Trevor Brown
d7542d9f8f Update get_tool_version_from_legacy_file function to check for script with dashes instead of underscores. 2015-11-29 12:09:39 -05:00
Trevor Brown
0a2ff4de5c Fix logic error that was causing .tool-versions file higher in directory tree to override legacy version file. 2015-11-28 18:02:58 -05:00
Trevor Brown
89c341829c First working version of utils.sh with legacy version file support. 2015-11-28 17:27:54 -05:00
Akash Manohar
ad0d365cf4 Executable check should use actual file path 2015-11-19 08:49:19 +05:30
Stratus3D
225c690893 Remove duplicate call to write_shim_script. 2015-11-13 11:36:25 -05:00
Trevor Brown
8e96be3243 Remove todo comment. 2015-11-05 06:43:12 -05:00
Trevor Brown
9bdc207ee2 Add check to ensure file is an executable in generate_shims_for_version function. 2015-11-05 06:35:53 -05:00
Akash Manohar
f4aa56b764 Merge pull request #20 from PSPDFKit-labs/master
Fix path: syntax in .tools-version & use exec
2015-10-26 08:17:57 +05:30
Martin Schürrer
aaa8abfd23 Don't spawn subshells, use exec 2015-10-01 19:31:53 +02:00
Akash Manohar J
89f5566fb4 Just use exit code 1 instead of inheriting it 2015-08-11 21:50:46 +05:30
Akash Manohar J
ec866a1bb1 Fix #19: Delete install path if install fails 2015-07-28 11:32:56 +05:30
Akash Manohar J
b4ef130a32 Fix looping 2015-06-24 22:43:15 +05:30
Akash Manohar J
2f8ffabde6 Fix #15: asdf install from .tool-versions; Fix loops 2015-06-24 20:41:13 +05:30
Akash Manohar J
d428c044fc fix get_tool_version_from_file 2015-06-24 19:33:25 +05:30
Akash Manohar J
9f99442603 Merge branch 'master' of github.com:HashNuke/asdf 2015-06-24 19:17:25 +05:30
Akash Manohar J
3d64dd99ab Read global tool versions file if local doesnt specify package 2015-06-24 19:16:49 +05:30
Kevin Disneur
8904de08d3
Skip installation if the version is already installed 2015-06-15 20:04:58 +01:00
Akash Manohar J
6f6ac56540 Merge branch 'master' of https://github.com/HashNuke/asdf 2015-06-15 18:32:42 +05:30
Akash Manohar J
77d4169cac 'Already installed' is a warning exit normally 2015-06-15 18:30:20 +05:30
Akash Manohar J
6b3a6f0011 Warn if plugin already installed 2015-06-15 18:29:27 +05:30
Akash Manohar J
bf0f9bc1fe Remove bulleting from plugin list 2015-06-14 18:55:20 +05:30
Kevin Disneur
7bb35d04ee
Update 'no plugin installed' message 2015-06-14 14:22:17 +01:00
Kevin Disneur
c2fc8dd34e
Add a command to list the plugins already installed 2015-06-14 13:37:48 +01:00
Akash Manohar J
681daec95a Check for custom shim templates in $plugin/shims 2015-06-07 00:30:55 +05:30
Akash Manohar J
1bfabd67fb Replace var names 2015-05-29 21:54:31 +05:30
Akash Manohar J
a59fddd265 Fix list command 2015-05-29 21:50:32 +05:30
Akash Manohar J
34222e34ab add where command to get install path 2015-05-29 00:08:13 +05:30
Akash Manohar J
00fa189b6e Rename package_name var to plugin_name everywhere 2015-05-27 12:16:17 +05:30
Akash Manohar J
ecd559545d package_name should be plugin_name 2015-05-27 12:13:26 +05:30
Akash Manohar J
d037628e7e Add which command 2015-05-27 12:13:10 +05:30
Akash Manohar J
97bdbc01b1 Fix shim and reshim 2015-05-24 15:12:30 +05:30
Akash Manohar J
0310c6e669 t push origin master
Merge branch 'master' of https://github.com/HashNuke/asdf
2015-05-24 15:04:35 +05:30
Akash Manohar J
44e991b49e mkdir install path 2015-05-24 15:04:20 +05:30
Akash Manohar J
3217a1f99e Merge and resolve conflicts 2015-05-24 15:03:56 +05:30
Akash Manohar J
bcb4780b33 Add shim command 2015-05-24 15:02:38 +05:30