Skip to content

Commit 2dfd123

Browse files
authored
Merge branch 'master' into add/keyring_support
2 parents 04c2e26 + 9867d0c commit 2dfd123

27 files changed

Lines changed: 648 additions & 147 deletions

.github/ISSUE_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Steps to reproduce
2+
3+
Tell us what actions you performed before the issue occurred
4+
5+
### Expected behavior
6+
7+
Tell us what should have happened
8+
9+
### Actual behavior
10+
11+
Tell us what happened instead
12+
13+
### Environment
14+
15+
**OS**:
16+
17+
**asdf version**:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Summary
2+
3+
Provide a general description of the code changes in your pull request.
4+
5+
Fixes: List issue numbers here
6+
7+
## Other Information
8+
9+
If there is anything else that is relevant to your pull request include that
10+
information here.
11+
12+
Thank you for contributing to asdf!

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
installs
22
plugins
33
shims
4+
repository
45
.vagrant
56
keyrings

CHANGELOG.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
1-
#Changelog
1+
# Changelog
22

3-
##0.2.1-dev
3+
## 0.3.1-dev
44

5-
##0.2.1
5+
Features
6+
7+
* Add CONTRIBUTING guidelines and GitHub issue and pull request templates
8+
9+
Fixed Bugs
10+
11+
## 0.3.0
12+
13+
Features
14+
15+
* Add `update` command to make it easier to update asdf to the latest release (#172, #180)
16+
* Add support for `system` version to allow passthrough to system installed tools (#55, #182)
17+
18+
Fixed Bugs
19+
20+
* Set `GREP_OPTIONS` and `GREP_COLORS` variables in util.sh so grep is always invoked with the correct settings (#170)
21+
* Export `ASDF_DIR` variable so the Zsh plugin can locate asdf if it's in a custom location (#156)
22+
* Don't add execute permission to files in a plugin's bin directory when adding the plugin (#124, #138, #154)
23+
24+
## 0.2.1
625

726
Features
827

@@ -14,7 +33,7 @@ Fixed Bugs
1433
* Remove shims when uninstalling a version or removing a plugin (#122, #123, #125, #128, #131)
1534
* Add a helpful error message to the install command (#135)
1635

17-
##0.2.0
36+
## 0.2.0
1837

1938
Features
2039

@@ -27,6 +46,6 @@ Fixed Bugs
2746
* Fix bug that caused the `local` command to crash when the directory contains whitespace (#90)
2847
* Misc typo corrections (#93, #99)
2948

30-
##0.1.0
49+
## 0.1.0
3150

3251
* First tagged release

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# How to Contribute to asdf
2+
3+
## Did you find a bug?
4+
5+
**Ensure the bug is actually an issue with asdf and not a plugin.** If the bug
6+
only occurs when using one tool installed by asdf and not others it's likely an
7+
issue with the asdf plugin. Find the plugin repository on
8+
[asdf-vm/asdf-plugins](https://github.com/asdf-vm/asdf-plugins) and follow the
9+
plugin creators instructions for reporting the bug.
10+
11+
**Ensure the bug was not already reported** by searching on GitHub under
12+
[Issues](https://github.com/asdf-vm/asdf/issues).
13+
14+
If you are unable to find an open issue addressing the problem please [open
15+
a new one](https://github.com/asdf-vm/asdf/issues/new). Please be as specific
16+
as possible when reporting the issue. Include the observed behavior as well as
17+
what you thought should have happened. Please also provide environmental
18+
details like asdf version, shell, OS, etc...
19+
20+
## Did you write a patch that fixes a bug?
21+
22+
Open a new GitHub pull request with the patch. Refer to the [Development
23+
section of the README](https://github.com/asdf-vm/asdf#development) for the
24+
details on how to run the unit tests. Please make sure that unit tests pass on
25+
Travis CI.
26+
27+
## Did you create a plugin for asdf?
28+
29+
Please read the [creating plugins](doc/creating-plugins.md) guide.
30+
31+
## Do you want to contribute the asdf documentation?
32+
33+
Documentation can always be improved! Right now there is just the
34+
[README](README.md) and the [creating plugins](doc/creating-plugins.md) guide.
35+
The [wiki](https://github.com/asdf-vm/asdf/wiki) exists but is in a state of
36+
disrepair. If you see something that can be improved please submit a pull
37+
request or edit the wiki.
38+
39+
Thanks for contributing!

README.md

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# asdf [![Build Status](https://travis-ci.org/asdf-vm/asdf.svg?branch=master)](https://travis-ci.org/asdf-vm/asdf)
22
### _extendable version manager_
33

4-
Supported languages include Ruby, Node.js, Elixir and more. Supporting a new language is as simple as [this plugin API](https://github.com/asdf-vm/asdf/blob/master/docs/creating-plugins.md).
4+
Supported languages include Ruby, Node.js, Elixir and [more](https://github.com/asdf-vm/asdf-plugins). Supporting a new language is as simple as [this plugin API](https://github.com/asdf-vm/asdf/blob/master/docs/creating-plugins.md).
55

66
## SETUP
77

88
Copy-paste the following into command line:
99

1010
```bash
11-
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.2.1
12-
11+
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.3.0
1312
```
1413

1514
Depending on your OS, run the following
@@ -34,7 +33,7 @@ mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.con
3433

3534
> For most plugins, it is good if you have installed the following packages OR their equivalent on your OS
3635
37-
> * **OS X**: Install these via homebrew `automake autoconf openssl libyaml readline libxslt libtool unixodbc`
36+
> * **OS X**: Install these via homebrew `coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc`
3837
> * **Ubuntu**: `automake autoconf libreadline-dev libncurses-dev libssl-dev libyaml-dev libxslt-dev libffi-dev libtool unixodbc-dev`
3938
> * **Fedora**: `automake autoconf readline-devel ncurses-devel openssl-devel libyaml-devel libxslt-devel libffi-devel libtool unixODBC-devel`
4039
@@ -47,44 +46,24 @@ mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.con
4746

4847
### Manage plugins
4948

50-
Plugins are how asdf understands how to handle different packages. Below is a list of plugins for languages. There is a [super-simple API](https://github.com/asdf-vm/asdf/blob/master/docs/creating-plugins.md) for supporting more languages.
51-
52-
| Language | Repository | CI Status
53-
|-----------|-------------|----------
54-
| Clojure | [vic/asdf-clojure](https://github.com/vic/asdf-clojure) | [![Build Status](https://travis-ci.org/vic/asdf-clojure.svg?branch=master)](https://travis-ci.org/vic/asdf-clojure)
55-
| Crystal | [marciogm/asdf-crystal](https://github.com/marciogm/asdf-crystal) | [![Build Status](https://travis-ci.org/marciogm/asdf-crystal.svg?branch=master)](https://travis-ci.org/marciogm/asdf-crystal)
56-
| D (DMD) | [sylph01/asdf-dmd](https://github.com/sylph01/asdf-dmd) | [![Build Status](https://travis-ci.org/sylph01/asdf-dmd.svg?branch=master)](https://travis-ci.org/sylph01/asdf-dmd)
57-
| Elixir | [asdf-vm/asdf-elixir](https://github.com/asdf-vm/asdf-elixir) | [![Build Status](https://travis-ci.org/asdf-vm/asdf-elixir.svg?branch=master)](https://travis-ci.org/asdf-vm/asdf-elixir)
58-
| Elm | [vic/asdf-elm](https://github.com/vic/asdf-elm) | [![Build Status](https://travis-ci.org/vic/asdf-elm.svg?branch=master)](https://travis-ci.org/vic/asdf-elm)
59-
| Erlang | [asdf-vm/asdf-erlang](https://github.com/asdf-vm/asdf-erlang) | [![Build Status](https://travis-ci.org/asdf-vm/asdf-erlang.svg?branch=master)](https://travis-ci.org/asdf-vm/asdf-erlang)
60-
| Go | [kennyp/asdf-golang](https://github.com/kennyp/asdf-golang) | [![Build Status](https://travis-ci.org/kennyp/asdf-golang.svg?branch=master)](https://travis-ci.org/kennyp/asdf-golang)
61-
| Haskell | [vic/asdf-haskell](https://github.com/vic/asdf-haskell) | [![Build Status](https://travis-ci.org/vic/asdf-haskell.svg?branch=master)](https://travis-ci.org/vic/asdf-haskell)
62-
| Idris | [vic/asdf-idris](https://github.com/vic/asdf-idris) | [![Build Status](https://travis-ci.org/vic/asdf-idris.svg?branch=master)](https://travis-ci.org/vic/asdf-idris)
63-
| Julia | [rkyleg/asdf-julia](https://github.com/rkyleg/asdf-julia) | [![Build Status](https://travis-ci.org/rkyleg/asdf-julia.svg?branch=master)](https://travis-ci.org/rkyleg/asdf-julia)
64-
| LFE | [vic/asdf-lfe](https://github.com/vic/asdf-lfe) | [![Build Status](https://travis-ci.org/vic/asdf-lfe.svg?branch=master)](https://travis-ci.org/vic/asdf-lfe)
65-
| Link (system tools) | [vic/asdf-link](https://github.com/vic/asdf-link) | [![Build Status](https://travis-ci.org/vic/asdf-link.svg?branch=master)](https://travis-ci.org/vic/asdf-link)
66-
| Lua | [Stratus3D/asdf-lua](https://github.com/Stratus3D/asdf-lua) | [![Build Status](https://travis-ci.org/Stratus3D/asdf-lua.svg?branch=master)](https://travis-ci.org/Stratus3D/asdf-lua)
67-
| LuaJIT | [smashedtoatoms/asdf-luaJIT](https://github.com/smashedtoatoms/asdf-luaJIT) | [![Build Status](https://travis-ci.org/smashedtoatoms/asdf-luaJIT.svg?branch=master)](https://travis-ci.org/smashedtoatoms/asdf-luaJIT)
68-
| MongoDB | [sylph01/asdf-mongodb](https://github.com/sylph01/asdf-mongodb) | [![Build Status](https://travis-ci.org/sylph01/asdf-mongodb.svg?branch=master)](https://travis-ci.org/sylph01/asdf-mongodb)
69-
| Node.js | [asdf-vm/asdf-nodejs](https://github.com/asdf-vm/asdf-nodejs) | [![Build Status](https://travis-ci.org/asdf-vm/asdf-nodejs.svg?branch=master)](https://travis-ci.org/asdf-vm/asdf-nodejs)
70-
| OpenResty | [smashedtoatoms/asdf-openresty](https://github.com/smashedtoatoms/asdf-openresty) | [![Build Status](https://travis-ci.org/smashedtoatoms/asdf-openresty.svg?branch=master)](https://travis-ci.org/smashedtoatoms/asdf-openresty)
71-
| Packer | [gozer/asdf-packer](https://github.com/gozer/asdf-packer) | [![Build Status](https://travis-ci.org/gozer/asdf-packer.svg?branch=master)](https://travis-ci.org/gozer/asdf-packer)
72-
| PHP | [odarriba/asdf-php](https://github.com/odarriba/asdf-php) | [![Build Status](https://travis-ci.org/odarriba/asdf-php.svg?branch=master)](https://travis-ci.org/odarriba/asdf-php)
73-
| Postgres | [smashedtoatoms/asdf-postgres](https://github.com/smashedtoatoms/asdf-postgres) | [![Build Status](https://travis-ci.org/smashedtoatoms/asdf-postgres.svg?branch=master)](https://travis-ci.org/smashedtoatoms/asdf-postgres)
74-
| Python | [tuvistavie/asdf-python](https://github.com/tuvistavie/asdf-python) | [![Build Status](https://travis-ci.org/tuvistavie/asdf-python.svg?branch=master)](https://travis-ci.org/tuvistavie/asdf-python)
75-
| Redis | [smashedtoatoms/asdf-redis](https://github.com/smashedtoatoms/asdf-redis) | [![Build Status](https://travis-ci.org/smashedtoatoms/asdf-redis.svg?branch=master)](https://travis-ci.org/smashedtoatoms/asdf-redis)
76-
| Riak | [smashedtoatoms/asdf-riak](https://github.com/smashedtoatoms/asdf-riak) | [![Build Status](https://travis-ci.org/smashedtoatoms/asdf-riak.svg?branch=master)](https://travis-ci.org/smashedtoatoms/asdf-riak)
77-
| Ruby | [asdf-vm/asdf-ruby](https://github.com/asdf-vm/asdf-ruby) | [![Build Status](https://travis-ci.org/asdf-vm/asdf-ruby.svg?branch=master)](https://travis-ci.org/asdf-vm/asdf-ruby)
78-
| Rust | [code-lever/asdf-rust](https://github.com/code-lever/asdf-rust) | [![Build Status](https://travis-ci.org/code-lever/asdf-rust.svg?branch=master)](https://travis-ci.org/code-lever/asdf-rust)
79-
| SBT | [lerencao/asdf-sbt](https://github.com/lerencao/asdf-sbt) | [![Build Status](https://travis-ci.org/lerencao/asdf-sbt.svg?branch=master)](https://travis-ci.org/lerencao/asdf-sbt)
80-
| Scala | [mtatheonly/asdf-scala](https://github.com/mtatheonly/asdf-scala)| [![Build Status](https://travis-ci.org/mtatheonly/asdf-scala.svg?branch=master)](https://travis-ci.org/mtatheonly/asdf-scala)
81-
| Terraform | [neerfri/asdf-terraform](https://github.com/neerfri/asdf-terraform) | [![Build Status](https://travis-ci.org/neerfri/asdf-terraform.svg?branch=master)](https://travis-ci.org/neerfri/asdf-terraform)
49+
Plugins are how asdf understands how to handle different packages.
50+
51+
You can find a list of all asdf plugins in the [plugins repository](https://github.com/asdf-vm/asdf-plugins).
52+
53+
There is a [super-simple API](https://github.com/asdf-vm/asdf/blob/master/docs/creating-plugins.md) for supporting more languages.
8254

8355
##### Add a plugin
8456

57+
```bash
58+
asdf plugin-add <name>
59+
# asdf plugin-add erlang
60+
```
61+
62+
If the plugin you want to install is not part of the plugins repository, you can add it using its repository URL:
63+
8564
```bash
8665
asdf plugin-add <name> <git-url>
87-
# asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
66+
# asdf plugin-add elm https://github.com/vic/asdf-elm
8867
```
8968

9069
##### List installed plugins
@@ -158,7 +137,7 @@ asdf current <name>
158137
```bash
159138
asdf global <name> <version>
160139
asdf local <name> <version>
161-
asdf global elixir 1.2.4
140+
# asdf global elixir 1.2.4
162141
```
163142

164143
`global` writes the version to `$HOME/.tool-versions`.
@@ -193,6 +172,7 @@ The versions can be in the following format:
193172
* `0.12.3` - an actual version. Plugins that support downloading binaries, will download binaries.
194173
* `ref:v1.0.2-a` or `ref:39cb398vb39` - tag/commit/branch to download from github and compile
195174
* `path:/src/elixir` - a path to custom compiled version of a tool to use. For use by language developers and such.
175+
* `system` - this keyword causes asdf to passthrough to the version of the tool on the system that is not managed by asdf.
196176

197177
To install all the tools defined in a `.tool-versions` file run the `asdf install` command with no other arguments in the directory containing the `.tool-versions` file.
198178

@@ -210,16 +190,34 @@ legacy_version_file = yes
210190

211191
* `legacy_version_file` - defaults to `no`. If set to yes it will cause plugins that support this feature to read the version files used by other version managers (e.g. `.ruby-version` in the case of Ruby's rbenv).
212192

193+
## Docker images
194+
195+
The [asdf-alpine](https://github.com/vic/asdf-alpine) and [asdf-ubuntu](https://github.com/vic/asdf-ubuntu) projects are an ongoing effort to provide Dockerized images of some asdf tools. You can use these docker images as base for your development servers, or for running your production apps.
196+
197+
## Development
198+
199+
To develop the project, you can simply `git clone` the master branch.
200+
If you want to try out your changes without making change to your installed `asdf`,
201+
you can set the `$ASDF_DIR` variable to the path where you cloned the repository,
202+
and temporarily prepend the `bin` and `shims` directory of the directory to your path.
203+
204+
We use [bats](https://github.com/sstephenson/bats) for testing,
205+
so make sure `bats test/` passes after you made your changes.
206+
207+
## Contributing
208+
209+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution guidelines.
210+
213211
## Credits
214212

215-
Me ([@HashNuke](http://github.com/HashNuke)), High-fever, cold, cough.
213+
Me ([@HashNuke](https://github.com/HashNuke)), High-fever, cold, cough.
216214

217215
Copyright 2014 to the end of time ([MIT License](https://github.com/asdf-vm/asdf/blob/master/LICENSE))
218216

219217
### Maintainers
220218

221-
- [@HashNuke](http://github.com/HashNuke)
222-
- [@tuvistavie](http://github.com/tuvistavie)
219+
- [@HashNuke](https://github.com/HashNuke)
220+
- [@tuvistavie](https://github.com/tuvistavie)
223221
- [@Stratus3D](https://github.com/Stratus3D)
224222
- [@vic](https://github.com/vic)
225223

asdf.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/env bash
22

33
if [ "${BASH_SOURCE[0]}" != "" ]; then
4-
current_script_path=${BASH_SOURCE[0]}
4+
current_script_path="${BASH_SOURCE[0]}"
55
else
6-
current_script_path=$0
6+
current_script_path="$0"
77
fi
88

9-
asdf_dir=$(cd $(dirname $current_script_path) &> /dev/null; echo $(pwd))
10-
export PATH="${asdf_dir}/bin:${asdf_dir}/shims:$PATH"
9+
export ASDF_DIR
10+
ASDF_DIR="$(cd "$(dirname "$current_script_path")" &> /dev/null || exit 1; pwd)"
11+
export PATH="${ASDF_DIR}/bin:${ASDF_DIR}/shims:$PATH"
1112

1213
if [ -n "$ZSH_VERSION" ]; then
1314
autoload -U bashcompinit

ballad-of-asdf.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Ballad of asdf
22

3-
> Once upon a time there was a programming language
4-
There were many versions of it
5-
So people wrote a version manager for it
6-
To switch between versions for projects
7-
Different, old, new.
3+
> Once upon a time there was a programming language<br/>
4+
> There were many versions of it<br/>
5+
> So people wrote a version manager for it<br/>
6+
> To switch between versions for projects<br/>
7+
> Different, old, new.
88
9-
> Then there came more programming languages
10-
So there came more version managers
11-
And many commands for them
9+
> Then there came more programming languages<br/>
10+
> So there came more version managers<br/>
11+
> And many commands for them
1212
13-
> I installed a lot of them
14-
I learnt a lot of commands
13+
> I installed a lot of them<br/>
14+
> I learnt a lot of commands
1515
16-
> Then I said, just one more version manager
17-
Which I will write instead
16+
> Then I said, just one more version manager<br/>
17+
> Which I will write instead
1818
19-
> So, there came another version manager
20-
**asdf version manager** - <https://github.com/HashNuke/asdf>
19+
> So, there came another version manager<br/>
20+
> **asdf version manager** - <https://github.com/HashNuke/asdf>
2121
22-
> A version manager so extendable
23-
for which anyone can create a plugin
24-
To support their favourite language
25-
No more installing more version managers
26-
Or learning more commands
22+
> A version manager so extendable<br/>
23+
> for which anyone can create a plugin<br/>
24+
> To support their favourite language<br/>
25+
> No more installing more version managers<br/>
26+
> Or learning more commands
2727
2828
---
2929

30-
*This was the mail I wrote to a few friends to tell them about the project. Thanks to [@roshanvid](http://twitter.com/roshanvid) for suggesting that this go into the readme*
30+
*This was the mail I wrote to a few friends to tell them about the project. Thanks to [@roshanvid](https://twitter.com/roshanvid) for suggesting that this go into the readme*

bin/asdf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
source $(dirname $(dirname $0))/lib/utils.sh
44

55
source $(dirname $(dirname $0))/lib/commands/help.sh
6+
source $(dirname $(dirname $0))/lib/commands/update.sh
67
source $(dirname $(dirname $0))/lib/commands/install.sh
78
source $(dirname $(dirname $0))/lib/commands/uninstall.sh
89
source $(dirname $(dirname $0))/lib/commands/current.sh
910
source $(dirname $(dirname $0))/lib/commands/where.sh
11+
source $(dirname $(dirname $0))/lib/commands/which.sh
1012
source $(dirname $(dirname $0))/lib/commands/version_commands.sh
1113
source $(dirname $(dirname $0))/lib/commands/list.sh
1214
source $(dirname $(dirname $0))/lib/commands/list-all.sh
@@ -30,6 +32,9 @@ case $1 in
3032
"help")
3133
help_command $callback_args;;
3234

35+
"update")
36+
update_command $callback_args;;
37+
3338
"install")
3439
install_command $callback_args;;
3540

@@ -42,6 +47,9 @@ case $1 in
4247
"where")
4348
where_command $callback_args;;
4449

50+
"which")
51+
which_command $callback_args;;
52+
4553
"local")
4654
local_command $callback_args;;
4755

0 commit comments

Comments
 (0)