1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-10-16 11:40:46 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
David Matheson
8cf080c01d
Merge 88214ad9f7 into 9bcafe1c27 2024-09-18 20:26:56 +02:00
Erik Teichmann
9bcafe1c27
feat(functions): add takezip (#12670) 2024-09-18 20:26:38 +02:00
Ruslan Tursunov
3151c9c1a3
fix(git): re-add accidentally removed gcn (#12681) 2024-09-18 12:58:00 +02:00
David Matheson
88214ad9f7 feat(sdkman): add basic initialization for sdkman 2024-07-28 13:09:23 -04:00
5 changed files with 36 additions and 0 deletions

View file

@ -57,6 +57,16 @@ function takeurl() {
cd "$thedir"
}
function takezip() {
local data thedir
data="$(mktemp)"
curl -L "$1" > "$data"
unzip "$data" -d "./"
thedir="$(unzip -l "$data" | awk 'NR==4 {print $4}' | sed 's/\/.*//')"
rm "$data"
cd "$thedir"
}
function takegit() {
git clone "$1"
cd "$(basename ${1%%.git})"
@ -65,6 +75,8 @@ function takegit() {
function take() {
if [[ $1 =~ ^(https?|ftp).*\.(tar\.(gz|bz2|xz)|tgz)$ ]]; then
takeurl "$1"
elif [[ $1 =~ ^(https?|ftp).*\.(zip)$ ]]; then
takezip "$1"
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
takegit "$1"
else

View file

@ -73,6 +73,7 @@ plugins=(... git)
| `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` |
| `gcann!` | `git commit --verbose --all --date=now --no-edit --amend` |
| `gc!` | `git commit --verbose --amend` |
| `gcn` | `git commit --verbose --no-edit` |
| `gcn!` | `git commit --verbose --no-edit --amend` |
| `gcs` | `git commit -S` |
| `gcss` | `git commit -S -s` |

View file

@ -197,6 +197,7 @@ alias gcan!='git commit --verbose --all --no-edit --amend'
alias gcans!='git commit --verbose --all --signoff --no-edit --amend'
alias gcann!='git commit --verbose --all --date=now --no-edit --amend'
alias gc!='git commit --verbose --amend'
alias gcn='git commit --verbose --no-edit'
alias gcn!='git commit --verbose --no-edit --amend'
alias gcf='git config --list'
alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'

14
plugins/sdkman/README.md Normal file
View file

@ -0,0 +1,14 @@
# sdkman
Plugin for SDKMAN, a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
Provides initialization for different scenarios where users may have installed.
To use it, add `sdkman` to your plugins array in your zshrc file:
```zsh
plugins=(... sdkman)
```
## Requirements
* [SDKMAN](http://sdkman.io/)

View file

@ -0,0 +1,8 @@
if [[ -z "$SDKMAN_DIR" ]]; then
if [[ -d "$HOME/.sdkman" ]]; then
export SDKMAN_DIR="$HOME/.sdkman"
else
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec" || echo "Cannot find SDKMAN!"
fi
fi
[[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh"