Skip to content

Commit

Permalink
Merge remote branch 'fork/16'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Feb 21, 2015
2 parents 181437f + 096b586 commit a86796f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you don't have and don't want to have this in your project's pom,
you can also do this:

```sh
echo 7 > .java-version
jvm local 7
```

On OSX, jvm will use the `java_home` tool to find the available versions. For
Expand Down
15 changes: 15 additions & 0 deletions jvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ _jvm-discover-and-set() {
[ ! -z "$version" ] && _jvm_set-java-path "$version"
}

jvm() {
if [ "$#" != 0 ]; then
local command="$1"; shift
fi
case "$command" in
local)
echo "$@" > .java-version
;;
*)
echo "Usage: jvm (local) <args>"
return 0
;;
esac
}

if [ ! -z "$BASH" ]; then
PROMPT_COMMAND=_jvm-discover-and-set
elif [ ! -z "$ZSH_NAME" ]; then
Expand Down

0 comments on commit a86796f

Please sign in to comment.