Skip to content

Commit

Permalink
feat: autoload and install volta
Browse files Browse the repository at this point in the history
  • Loading branch information
r17x committed Jun 29, 2021
0 parents commit d26d39b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright © 2020 ri7nz

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ZSH Plugin - Volta
ZSH Plugin to install and load [**Volta: JS Toolchains as Code. ⚡**](https://github.com/volta-cli/volta)

## Table of Content
<!-- vim-markdown-toc GFM -->

* [Installation](#installation)
* [Zinit](#zinit)
* [Zplug](#zplug)
* [Similar Projects](#similar-projects)

<!-- vim-markdown-toc -->
## Installation

### Zinit
```zsh
zinit light "ri7nz/zsh-volta"
```

### Zplug
```zsh
zplug "ri7nz/zsh-volta"
```

## Similar Projects
- [**zsh-yarn**](https://github.com/ri7nz/zsh-yarn)
- [**zsh-fnm**](https://github.com/dominik-schwabe/zsh-fnm)
- [**zsh-nvm**](https://github.com/lukechilds/zsh-nvm)
11 changes: 11 additions & 0 deletions zsh-volta.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
command -v volta &>/dev/null || {
print -P "%F{33}▓▒░ %F{34}checking %F{33}Volta%F{220}...%f"
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
command -v volta &>/dev/null || {
print -P "%F{33}▓▒░ %F{220}Installing %F{33}Volta%F{220}…%f"
curl -fsSL https://get.volta.sh | bash
print -P "%F{33}▓▒░ %F{34} ✅ %F{33}Volta%F{220} installation succeeded %f%b"
}
print -P "%F{33}Volta%F{220} was installed in %F{160}$VOLTA_HOME%F{220}%f%b"
}

0 comments on commit d26d39b

Please sign in to comment.