Skip to content

Commit

Permalink
v2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Aug 7, 2016
1 parent 305b88c commit bb0e48e
Show file tree
Hide file tree
Showing 154 changed files with 5,802 additions and 3,475 deletions.
26 changes: 19 additions & 7 deletions .gitignore
@@ -1,14 +1,26 @@
.DS_Store
**/.DS_Store
.ignore
# zplug
bin/*
!bin/zplug-env
repos/*
.cache
.gitignore.d/*

# zsh
zcompdump
**/zcompdump
zcompdump.zwc
**/zcompdump.zwc
**/*~
**/*.swp
.cache
repos

# a2x (man page)
*.xml
**/*.xml

# vim
*~
**/*~
*.swp
**/*.swp

# OS X
.DS_Store
**/.DS_Store
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -11,7 +11,7 @@ sudo: false
before_script:
- zsh --version
script:
- make test
- TEST_TARGET=test/all.t make test
notifications:
slack:
secure: t60Xlx634DaOWN1VRaIFPfXTAUb5188pR1IFrvIoYWqBMY0vP8AihxQP80fwnaOQGaIcbjDLjlU6CV8R2J/uXw4QKOsF0VF93X1NdNyuu3wRC/Kqe/FERYTwhMy2/b9Sf2fWe5eEE4fcpnX2GtJnDzzGoesLe5GvRL+mqJLN+sgAnszQp9++aybktZ0lkpaEMYWu0V96sZOdKqsxxOF4wpMt4Z3hBPi0mA3OgwxIh+0sg55czIcMl7ZLtAtm4fCSDHKojQvbaBUSfsRR6LjTb6a5b6hQBtL9n5xRzHN3J82T5noPLlj2zg+EWlLIwD5pGdkSpPAfQUb+/pNHALGijEXXDfosPGOJWI4EU1EhC1/H7zzkOPcPzEX6X+s3vx8ruObg3vvVsOYU3hqNcxz63zgw0NDLVVVnOV4+VusIDI5rxKUaVtFBH7nJf5cLu9+AF6RjVgZyuozlHvsecinl3YdyenD3saYkqRMJn3mQaWND1c2PnZWtNoclJbRwcilf3OFkl+LGskq39HluYZ8VTVE95FkfuGtN9P1v/C7XPSD1/VPKY+3hWbMpfKFQpNgy2D67mVuuiRtHAszTw80qq0IPEcdX1nYtJrzNclUb9FTXpy6etUHyQbkND8B9brw580sYgdJfavgaaKLF7usZrUlOcayzMd6j6eEPmN7b1QY=
43 changes: 17 additions & 26 deletions Makefile
@@ -1,35 +1,26 @@
ZPLUG_ROOT := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
ZSPEC := $(ZPLUG_ROOT)/bin/zspec
ZSPEC_URL := https://raw.githubusercontent.com/b4b4r07/zspec/master/bin/zspec
MANPAGE := $(ZPLUG_ROOT)/doc/man/man1/zplug.1
MANPATH := /usr/local/share/man/man1
LICENSE_URL := http://b4b4r07.mit-license.org
LICENSE_TXT := $(ZPLUG_ROOT)/doc/LICENSE-MIT.txt
SHOVE_URL := https://github.com/key-amb/shove
SHOVE_DIR := $(ZPLUG_ROOT)/.gitignore.d/shove
TEST_TARGET ?= test

SKIP_FILES := __clone__ __releases__ __install__ __update__ __load__
TEST_FILES := $(shell find $(ZPLUG_ROOT)/test -name *_test.zsh | sort)
SKIP_TESTS := $(foreach f, $(SKIP_FILES), $(shell find $(ZPLUG_ROOT)/test -name $(f)_test.zsh))
MINI_TESTS := $(filter-out $(SKIP_TESTS), $(TEST_FILES))
.DEFAULT_GOAL := help

.PHONY: all install man zspec minitest test license
.PHONY: all install shove test license help

all:

install: man license
@cat $(LICENSE_TXT)
install: ## Install zplug to your machine

man:
@test -f $(MANPATH)/zplug.1 || cp -v -f $(MANPAGE) $(MANPATH)
shove: # Grab shove from GitHub and grant execution
@if [ ! -d $(SHOVE_DIR) ]; then \
git clone $(SHOVE_URL) $(SHOVE_DIR); \
chmod 755 $(SHOVE_DIR)/bin/shove; \
fi

zspec:
@test -f $(ZSPEC) || curl -L $(ZSPEC_URL) -o $(ZSPEC)
@test -x $(ZSPEC) || chmod 755 $(ZSPEC)
test: shove ## Unit test for zplug
ZPLUG_ROOT=$(ZPLUG_ROOT) $(SHOVE_DIR)/bin/shove -r $(TEST_TARGET) -s zsh

minitest: zspec
@ZPLUG_ROOT=$(ZPLUG_ROOT) $(ZSPEC) $(MINI_TESTS)

test: zspec
@ZPLUG_ROOT=$(ZPLUG_ROOT) $(ZSPEC) $(TEST_FILES)

license:
@curl -fsSL -o $(LICENSE_TXT) $(LICENSE_URL)
help: ## Self-documented Makefile
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
13 changes: 8 additions & 5 deletions README.md
@@ -1,3 +1,5 @@
:us: [:jp:](./doc/guide/README.ja.md)

> Zsh Plugin Manager
[![Travis][travis-badge]][travis-link]
Expand Down Expand Up @@ -62,9 +64,9 @@ $ git clone https://github.com/zplug/zplug $ZPLUG_HOME

## Requirements

- `zsh` version 4.3.9 or higher
- `git` version 1.7 or higher
- `awk` An AWK variant that's **not** `mawk`
- `zsh`: version 4.3.9 or higher
- `git`: version 1.7 or higher
- `awk`: An AWK variant that's **not** `mawk`

## Usage

Expand Down Expand Up @@ -172,10 +174,10 @@ Finally, use `zplug install` to install your plugins and reload `.zshrc`.

| Command | Description | Options |
|-----------|-------------|---------|
| `install` | Install packages in parallel | `--verbose`,`--select` |
| `install` | Install packages in parallel | (None) |
| `load` | Source installed plugins and add installed commands to `$PATH` | `--verbose` |
| `list` | List installed packages (more specifically, view the associative array `$zplugs`) | `--select` |
| `update` | Update installed packages in parallel | `--self`,`--select` |
| `update` | Update installed packages in parallel | `--self`,`--select`,`--force` |
| `check` | Return true if all packages are installed, false otherwise | `--verbose` |
| `status` | Check if the remote repositories are up to date | `--select` |
| `clean` | Remove repositories which are no longer managed | `--force`,`--select` |
Expand Down Expand Up @@ -333,6 +335,7 @@ Defaults to `$ZPLUG_HOME/.cache`. You can change where the cache file is saved,
Defaults to `$ZPLUG_HOME/repos`. You can change where the repositories are cloned in case you want to manage them separately.

### External commands

zplug, like `git(1)`, supports external commands.
These are executable scripts that reside somewhere in the PATH, named `zplug-cmdname`,
which can be invoked with `zplug cmdname`.
Expand Down
24 changes: 0 additions & 24 deletions autoload/autoload.zsh

This file was deleted.

76 changes: 46 additions & 30 deletions autoload/commands/__check__
@@ -1,13 +1,11 @@
#!/usr/bin/env zsh
# Description:
# Return true if all packages are installed, false otherwise

__import "core/core"
__import "print/print"
__import "job/spinner"

local is_verbose=false
local arg line
local -a args fail
local -A zspec
local is_verbose=false
local arg repo
local -aU repos not_installed_repos
local -A tags

while (( $# > 0 ))
do
Expand All @@ -17,46 +15,64 @@ do
is_verbose=true
;;
-*|--*)
__zplug::print::print::die "[zplug] $arg: Unknown option\n"
__zplug::core::options::unknown "$arg"
return $status
;;
"")
# Invalid
return 1
;;
*/*)
repos+=( "${arg:gs:@::}" )
;;
*)
args+=("$arg")
return 1
;;
esac
shift
done

for line in ${${args[@]:-${(k)zplugs[@]}}:gs:@::}
do
__parser__ "$line"
zspec=( "${reply[@]}" )
if [[ $zspec[from] == local ]]; then
continue
fi
if (( $#repos == 0 )); then
repos=( "${(k)zplugs[@]:gs:@::}" )
fi

if [[ -n $zspec[if] ]] && ! eval "$zspec[if]" &>/dev/null; then
for repo in "${repos[@]}"
do
tags[from]="$(
__zplug::core::core::run_interfaces \
'from' \
"$repo" \
2> >(__zplug::io::log::capture)
)"
if [[ -z "$tags[from]" ]]; then
not_installed_repos+=( "$repo" )
continue
fi

if __zplug::core::core::is_handler_defined check "$zspec[from]"; then
__zplug::core::core::use_handler check "$zspec[from]" "$line"
if __zplug::core::sources::is_handler_defined "check" "$tags[from]"; then
__zplug::core::sources::use_handler \
"check" \
"$tags[from]" \
"$repo"

if (( $status )); then
fail+=("$zspec[name]")
fi
else
if [[ ! -d $zspec[dir] ]]; then
fail+=("$zspec[name]")
if (( $status != 0 )); then
not_installed_repos+=( "$repo" )
fi
fi
done

if (( $#fail > 0 )); then
if (( $#not_installed_repos > 0 )); then
# Share not installed repos information
# e.g. for __install__ command
reply=( "${not_installed_repos[@]}" )

if $is_verbose; then
__zplug::print::print::put "- $fg[red]%s$reset_color: not installed\n" "${(@nO)fail}"
__zplug::io::print::put \
"- $fg[red]%s$reset_color: not installed\n" \
"${not_installed_repos[@]}"
fi

return 1
else
return 0
fi

return 0

0 comments on commit bb0e48e

Please sign in to comment.