mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
plugins: added nvm and sdkman (#150)
* feat(plugins): added sdkman plugin * feat(plugins): added nvm plugin * fix: fixed the codacy issues
This commit is contained in:
committed by
GitHub
parent
48df2df79c
commit
3ebd9b84f4
25
plugins/sdkman/README.md
Normal file
25
plugins/sdkman/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# sdkman plugin
|
||||
|
||||
This plugin automatically source sdkman[1]
|
||||
|
||||
## Installation
|
||||
|
||||
### Install sdkman
|
||||
|
||||
Lets install[2] the sdkman without updaing shell config!
|
||||
|
||||
```bash
|
||||
$ curl -s "https://get.sdkman.io?rcupdate=false" | bash
|
||||
```
|
||||
|
||||
### Include sdkman as plugin
|
||||
|
||||
```bash
|
||||
plugins=(
|
||||
git
|
||||
sdkman
|
||||
)
|
||||
```
|
||||
|
||||
[1]: https://sdkman.io/
|
||||
[2]: https://sdkman.io/install
|
9
plugins/sdkman/sdkman.plugin.sh
Normal file
9
plugins/sdkman/sdkman.plugin.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Set NVM_DIR if it isn't already defined
|
||||
[[ -z "$SDKMAN_DIR" ]] && export NVM_DIR="$HOME/.sdkman"
|
||||
|
||||
# Try to load sdk only if command not already available
|
||||
if ! type "sdk" &> /dev/null; then
|
||||
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||
fi
|
Reference in New Issue
Block a user