Ahoy! We are getting close to 0.8.0

* Move AUTHORS -> THANKS and remove automatic generation.

THANKS is more sensible than AUTHORS. CREDITS was second best.
Also, after perusing similar files in other projects I noticed
some entries lacking a valid email address and decided fow now
this file should be curated manually to make sure each entry
contains a useful link. This allows users who have contributed
to the project ways other than committing code to be added to
the list as well.

* Rename wait -> spin.

* Remove extra padding in links. (Cosmetic)

* Update to reflect API refactorings.

* Fix bug causing brackets to show up in description.

* Implement using spin function.

* __fisher_gist_to_name uses curl to query the GitHub API which will
return a JSON stream even if the Gist could not be found. So, it's
not possible to determine whether we failed or not using our spin
function and actually need to check the returned string to see if
it contains a valid name or not.

* Let git pull write errors to stderr.

* Use new internal __fisher_spin.

* Extract spin to independent / external module and tweak Makefile
to better integrate with new install process.
This commit is contained in:
Jorge Bucaran 2016-02-13 20:37:49 +09:00
parent 4c0ddb1b28
commit 692bb22db6
45 changed files with 139 additions and 544 deletions

View file

@ -4,4 +4,4 @@ before_install:
- sudo apt-get update - sudo apt-get update
- sudo apt-get -y install fish - sudo apt-get -y install fish
script: script:
- make && fish -c "fisher install fishtape; fishtape test/*.fish" - make && fish -c "__fisher_index_update; fisher_install fishtape; fishtape test/*.fish"

View file

@ -1,6 +0,0 @@
# Authors
* Jorge Bucaran <[j@bucaran.me](mailto:j@bucaran.me)>
* Daniel Perez <[daniel@claudetech.com](mailto:daniel@claudetech.com)>
* Daniele Sluijters <[daenney@users.noreply.github.com](mailto:daenney@users.noreply.github.com)>
* Hyeon Kim <[simnalamburt@gmail.com](mailto:simnalamburt@gmail.com)>
* Kevin Ballard <[kevin@sb.org](mailto:kevin@sb.org)>

View file

@ -1,5 +1,21 @@
# Change Log # Change Log
## [0.8.0][v080] - 2016-02-15
* Add new **debug** mode enabled by setting a new `$fisher_debug` global / universal variable. For advanced logging and color options, install: [`fish_debug`](https://github.com/fishery/debug).
```fish
fisher install debug
```
This mode makes commands behave verbosely and forces Fisherman to log all kinds of diagnostic information as well as run some simple health checks.
* Several updates to the [website][http://fisherman.sh]. Changed to using the new SVG logo. More appeal using grammar tweaks. Drop some hardly ever used favicons and switch from SourceCodePro to Monaco style monospace fonts that load faster and cause less pollution.
* Renamed core function `wait` to `spin` to reflect usage more accurately and updated its usage across Fisherman accordingly.
* Renamed `$fisher_key_bindings` variable to `$fisher_binds` because it's shorter to type and makes `config.fish` look neater.
## [0.7.0][v070] - 2016-02-11 ## [0.7.0][v070] - 2016-02-11
* Welcome aboard @daenney, the newest Fisherman organization member. If you want to be part of the organization just let [me](https://github.com/bucaran) or @daenney know. * Welcome aboard @daenney, the newest Fisherman organization member. If you want to be part of the organization just let [me](https://github.com/bucaran) or @daenney know.
@ -28,7 +44,7 @@
* Tweak validate regex to correctly handle plugins that could be named `bb`, `gh`, `gl` or `omf`. * Tweak validate regex to correctly handle plugins that could be named `bb`, `gh`, `gl` or `omf`.
* **wait.fish** Add a single " " space after spinner by default. To remove the white space use a format like `--format="@\r"`. * **spin.fish** Add a single " " space after spinner by default. To remove the white space use a format like `--format="@\r"`.
* Supress unwated error message when the cache is empty. Closes #66. * Supress unwated error message when the cache is empty. Closes #66.
@ -36,7 +52,6 @@
* Create empty fishfile during make install. * Create empty fishfile during make install.
## [0.5.0][v050] - 2016-02-02 ## [0.5.0][v050] - 2016-02-02
* **Add user key bindings support.** (See #42). * **Add user key bindings support.** (See #42).
@ -69,7 +84,6 @@
+ Improve Install/Uninstall/Update status output. If a plugin fails to install decrease the total. If any plugins are skipped because they are already installed in the case of `fisher install` or available in the cache, but disabled in the case of `fisher uninstall` they are collected into an array and displayed in a new section `n plugin/s skipped (a, b, c)` at the bottom of the report. + Improve Install/Uninstall/Update status output. If a plugin fails to install decrease the total. If any plugins are skipped because they are already installed in the case of `fisher install` or available in the cache, but disabled in the case of `fisher uninstall` they are collected into an array and displayed in a new section `n plugin/s skipped (a, b, c)` at the bottom of the report.
* **Improve test coverage.** * **Improve test coverage.**
+ Tightly coupled functions were making testing increasingly difficult. Most of the test effort was basically testing whether `git clone` or `git pull`. New separation of concerns makes tests run faster and the difficult install/uninstall algorithms has better coverage now. + Tightly coupled functions were making testing increasingly difficult. Most of the test effort was basically testing whether `git clone` or `git pull`. New separation of concerns makes tests run faster and the difficult install/uninstall algorithms has better coverage now.
@ -92,7 +106,6 @@
+ Prepend `*` to plugin names to indicate they are currently enabled when using `fisher --list[=cache]`. See #49. + Prepend `*` to plugin names to indicate they are currently enabled when using `fisher --list[=cache]`. See #49.
## [0.4.0][v040] - 2016-01-11 ## [0.4.0][v040] - 2016-01-11
* Introducing Fisherman's official website, hosted by GitHub pages. * Introducing Fisherman's official website, hosted by GitHub pages.
@ -144,7 +157,6 @@
* :warning: Remove `fisher --cache` and `fisher --validate`. Now, that these options are separated into their own function and they are intentionally private, there is no need for them. * :warning: Remove `fisher --cache` and `fisher --validate`. Now, that these options are separated into their own function and they are intentionally private, there is no need for them.
## [0.3.0][v030] - 2016-01-08 ## [0.3.0][v030] - 2016-01-08
> This release contains several breaking changes a few major improvements. The good news is that the API is starting to look more stable and very unlikely to change drastically again in the future. > This release contains several breaking changes a few major improvements. The good news is that the API is starting to look more stable and very unlikely to change drastically again in the future.
@ -157,7 +169,7 @@
* Fix a bug in install, update and uninstall that was displaying an incorrect plugin count if there was at least on failure. * Fix a bug in install, update and uninstall that was displaying an incorrect plugin count if there was at least on failure.
* Fix bug in `fisher install` that causes install to fail even though it succeeds, due to `wait(1)`'s behavior of returning `1` if there is any output to standard error. See #20. * Fix bug in `fisher install` that causes install to fail even though it succeeds, due to `spin(1)`'s behavior of returning `1` if there is any output to standard error. See #20.
* Fix bug in `fisher uninstall` that was removing plugins from the cache by mistake. * Fix bug in `fisher uninstall` that was removing plugins from the cache by mistake.
@ -209,7 +221,6 @@
* Revert #3. The reason `getopts.fish` was in its own file originally is because @bucaran wanted a standalone, dependency free cli parser solution, arguably slightly faster than having Awk read `getopts.awk` for each use. The performance improvement is negligible at best, but `getopts` is also used by every single command and future commands and plugins are very likely to use it as well, so we might as well use the slightly faster version. * Revert #3. The reason `getopts.fish` was in its own file originally is because @bucaran wanted a standalone, dependency free cli parser solution, arguably slightly faster than having Awk read `getopts.awk` for each use. The performance improvement is negligible at best, but `getopts` is also used by every single command and future commands and plugins are very likely to use it as well, so we might as well use the slightly faster version.
## [0.2.0][v020] - 2016-01-05 ## [0.2.0][v020] - 2016-01-05
* Improve README, added links to screencasts, updated documentation with new changes and fixed other typos and composition errors. * Improve README, added links to screencasts, updated documentation with new changes and fixed other typos and composition errors.
@ -238,14 +249,10 @@
* Refactor and improve tests for `install`, `update` and `uninstall`. * Refactor and improve tests for `install`, `update` and `uninstall`.
## [0.1.0][v010] - 2016-01-01 ## [0.1.0][v010] - 2016-01-01
* Initial commit. * Initial commit.
:anchor:
<!-- Links --> <!-- Links -->
[v100]: https://github.com/fisherman/fisherman/releases/tag/1.0.0 [v100]: https://github.com/fisherman/fisherman/releases/tag/1.0.0

View file

@ -15,69 +15,48 @@ MAN7 := $(wildcard $(MAN)/man7/*.md)
DOCS := $(MAN1:%.md=%.1) $(MAN5:%.md=%.5) $(MAN7:%.md=%.7) DOCS := $(MAN1:%.md=%.1) $(MAN5:%.md=%.5) $(MAN7:%.md=%.7)
INDEX := $(FISHER_CACHE)/.index INDEX := $(FISHER_CACHE)/.index
AUTHORS = $(FISHER_HOME)/AUTHORS.md
VERSION = `cat $(FISHER_HOME)/VERSION` VERSION = `cat $(FISHER_HOME)/VERSION`
MSG = printf "\033[47m\033[30m%s\033[0m\n" $(1)
TILDEIFY = sed "s|$$HOME|~|"
.PHONY: all test flush uninstall release .PHONY: all test flush uninstall release
all: $(FISH_CONFIG) $(FISHER_CACHE) $(FISHER_FILE) $(AUTHORS) $(DOCS) all: $(FISH_CONFIG) $(FISHER_CACHE) $(FISHER_FILE) $(DOCS)
@if [ ! -s $(INDEX) ]; then\ @echo "** Reload your shell and type 'fisher' to get started **"
echo "Downloading the index for the first time...";\
fish -c "__fisher_index_update 0";\
fi
@$(call MSG,"Ahoy! Reset your shell and type 'fisher <command>'")
@fish -c "fisher help -a" | sed -n '3,$$p'
test: test:
@fish -c "fishtape test/*.fish" fish -c "fishtape test/*.fish"
flush:
@rm -rf $(FISHER_CONFIG)/*
uninstall: uninstall:
@echo "Removing configuration from $(FISH_CONFIG)" | $(TILDEIFY) sed -E '/set (fisher_home|fisher_config) /d;/source \$$fisher_home/d' \
@sed -E '/set (fisher_home|fisher_config) /d;/source \$$fisher_home/d' \
$(FISH_CONFIG) > $(FISH_CONFIG).tmp $(FISH_CONFIG) > $(FISH_CONFIG).tmp
@mv $(FISH_CONFIG).tmp $(FISH_CONFIG) mv $(FISH_CONFIG).tmp $(FISH_CONFIG)
@$(call MSG,"Reset your shell to apply changes.") $(call MSG,"Reload your shell to apply changes.")
release: $(FISHER_HOME) release: $(FISHER_HOME)
@if [ "`git -C $^ status --short --porcelain | xargs`" = "M VERSION" ]; then\ if [ "`git -C $^ status --short --porcelain | xargs`" = "M VERSION" ]; then\
echo "`git -C $^ describe --abbrev=0 2>/dev/null || echo \*` -> $(VERSION)";\ echo "`git -C $^ describe --abbrev=0 2>/dev/null || echo \*` -> $(VERSION)";\
sed "s/latest-v.\..\..-00B9FF/latest-v$(VERSION)-00B9FF/" $^/README.md > $^/README.md.swap;\ sed "s/latest-v.\..\..-00B9FF/latest-v$(VERSION)-00B9FF/" $^/README.md > $^/README.md.swap;\
mv $^/README.md.swap $^/README.md;\ mv $^/README.md.swap $^/README.md;\
git -C $^ add README.md;\ git -C $^ add README.md;\
git -C $^ add $^/VERSION;\ git -C $^ add $^/VERSION;\
git -C $^ commit --quiet -m $(VERSION);\ git -C $^ commit --quiet -m $(VERSION);\
git -C $^ tag $(VERSION) -m v$(VERSION) --force >/dev/null;\ git -C $^ tag $(VERSION) -m v$(VERSION) --force > /dev/null;\
else\ else\
echo "Commit changes and update VERSION to tag a new release.";\ echo "Commit changes and update VERSION to tag a new release.";\
fi fi
$(FISH_CONFIG): $(FISH_CONFIG):
@echo "Adding configuration to $@" | $(TILDEIFY) mkdir -p $(dir $@) && touch $@
@mkdir -p $(dir $@) && touch $@ echo "set fisher_home $(FISHER_HOME)" | sed "s|/$$||;s|$$HOME|~|" > $@.fisher
@echo "set fisher_home $(FISHER_HOME)" | sed "s|/$$||;s|$$HOME|~|" > $@.fisher echo "set fisher_config $(FISHER_CONFIG)" | sed "s|$$HOME|~|" >> $@.fisher
@echo "set fisher_config $(FISHER_CONFIG)" | sed "s|$$HOME|~|" >> $@.fisher echo "source \$$fisher_home/config.fish" >> $@.fisher
@echo "source \$$fisher_home/config.fish" >> $@.fisher awk 'FNR==NR{ print; a[$$0]; next } !($$0 in a) || /^$$/' $@.fisher $@ > $@.tmp
@awk 'FNR==NR{ print; a[$$0]; next } !($$0 in a) || /^$$/' $@.fisher $@ > $@.tmp mv $@.tmp $@ && rm $@.fisher
@mv $@.tmp $@ && rm $@.fisher
$(FISHER_CACHE): $(FISHER_CACHE):
@[ -d $@ ] || echo "Creating $@" | $(TILDEIFY) mkdir -p $@
@mkdir -p $@
$(FISHER_FILE): $(FISHER_FILE):
@touch $@ touch $@
$(AUTHORS): $(FISHER_HOME)
@echo "# Authors" > $@
@git -C $^ shortlog -sne | cut -f2- | \
sed -E 's/([^<>]+)<([^<>]*)>/* \1 \&lt;[\2](mailto:\2)\&gt;/' >> $@
%.1 %.5 %.7: %.md %.1 %.5 %.7: %.md
-@if type ronn 2>/dev/null 1>&2; then \ -@if type ronn 2>/dev/null 1>&2; then \

View file

@ -51,24 +51,24 @@ For documentation and guides [see the wiki][wiki]. For questions and feedback jo
<!-- Header --> <!-- Header -->
[travis-link]: https://travis-ci.org/fisherman/fisherman [travis-link]: https://travis-ci.org/fisherman/fisherman
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square [travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
[version-badge]: https://img.shields.io/badge/latest-v0.7.0-00B9FF.svg?style=flat-square [version-badge]: https://img.shields.io/badge/latest-v0.7.0-00B9FF.svg?style=flat-square
[version-link]: https://github.com/fisherman/fisherman/releases [version-link]: https://github.com/fisherman/fisherman/releases
[slack-link]: https://fisherman-wharf.herokuapp.com/ [slack-link]: https://fisherman-wharf.herokuapp.com/
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square [slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
<!-- About --> <!-- About -->
[fish]: https://github.com/fish-shell/fish-shell [fish]: https://github.com/fish-shell/fish-shell
[quickstart]: https://github.com/fisherman/fisherman/wiki/Quickstart-Guide [quickstart]: https://github.com/fisherman/fisherman/wiki/Quickstart-Guide
<!-- Performance --> <!-- Performance -->
[fundle]: https://github.com/tuvistavie/fundle/blob/master/functions/fundle.fish#L232 [fundle]: https://github.com/tuvistavie/fundle/blob/master/functions/fundle.fish#L232
[performance]: https://github.com/fisherman/fisherman/wiki/Performance [performance]: https://github.com/fisherman/fisherman/wiki/Performance
<!-- Documentation --> <!-- Documentation -->
[wiki]: https://github.com/fisherman/fisherman/wiki [wiki]: https://github.com/fisherman/fisherman/wiki
[issues]: http://github.com/fisherman/fisherman/issues [issues]: http://github.com/fisherman/fisherman/issues

12
THANKS.md Normal file
View file

@ -0,0 +1,12 @@
# Thank You
The following individuals have contributed to Fisherman.
* Daniel Perez @tuvistavie
* Daniele Sluijters @daenney
* Hyeon Kim @simnalamburt
* Ian @ViViDboarder
* Jorge Bucaran @bucaran
* Kevin Ballard @kballard
:heart:

View file

@ -4,6 +4,8 @@ complete -c fisher -n "__fish_use_subcommand" -s l -l list -d "List plugins enab
complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Display help" complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Display help"
complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information" complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information"
complete -c fisher -a "fisherman" -d "Update Fisherman" -n "__fish_seen_subcommand_from update"
complete -c fisher -a "\t" -n "__fish_seen_subcommand_from search" complete -c fisher -a "\t" -n "__fish_seen_subcommand_from search"
complete -c fisher -l "name" -d "Filter by name" -n "__fish_seen_subcommand_from search" complete -c fisher -l "name" -d "Filter by name" -n "__fish_seen_subcommand_from search"
complete -c fisher -l "url" -d "Filter by url" -n "__fish_seen_subcommand_from search" complete -c fisher -l "url" -d "Filter by url" -n "__fish_seen_subcommand_from search"
@ -25,6 +27,10 @@ for option in commands guides
end end
end end
if test ! -e $fisher_cache/.index
exit
end
set -l plugins ( set -l plugins (
if test -s $fisher_file if test -s $fisher_file
__fisher_file < $fisher_file | __fisher_name __fisher_file < $fisher_file | __fisher_name
@ -32,7 +38,6 @@ set -l plugins (
) )
begin begin
awk -F '\n' -v RS='' -v OFS=';' '/^ *#/ { next } { print $1, $3 }' $fisher_cache/.index awk -F '\n' -v RS='' -v OFS=';' '/^ *#/ { next } { print $1, $3 }' $fisher_cache/.index
__fisher_cache_list __fisher_cache_list
@ -43,7 +48,4 @@ end | sort -ut ';' -k1,1 | while read -l name info
else else
complete -c fisher -n "__fish_seen_subcommand_from i install" -a "$name" -d "$info" complete -c fisher -n "__fish_seen_subcommand_from i install" -a "$name" -d "$info"
end end
end end
complete -c fisher -n "__fish_seen_subcommand_from update" -a "fisherman" -d "Update Fisherman"

View file

@ -1,8 +0,0 @@
set -l IFS \t
complete -xc wait -n "__fish_seen_subcommand_from --spin" \
-a "spinners arc star pipe ball flip mixer caret bar1 bar2 bar3"
complete -xc wait -n "not __fish_seen_subcommand_from --spin" -a "\t"
wait -h | __fisher_complete wait

View file

@ -1,9 +1,9 @@
set -g fisher_file $fisher_config/fishfile set -g fisher_file $fisher_config/fishfile
set -g fisher_cache $fisher_config/cache set -g fisher_cache $fisher_config/cache
set -g fisher_key_bindings $fisher_config/key_bindings.fish set -g fisher_binds $fisher_config/key_bindings.fish
set -g fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_path set -g fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_path
set -g fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path set -g fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path
for file in $fisher_config/conf.d/*.fish for file in $fisher_config/conf.d/*.fish
source $file source $file

View file

@ -13,7 +13,7 @@ function __fisher_file
} }
!/^[ \t]*(#.*)*$/ { !/^[ \t]*(#.*)*$/ {
gsub("^[|*>]|#.*", "") gsub("^[@*>]|#.*", "")
if (! seen[$1]++) { if (! seen[$1]++) {
printf("%s\n", $1) printf("%s\n", $1)

View file

@ -1,13 +1,8 @@
function __fisher_gist_to_name -a url function __fisher_gist_to_name -a url
if test -z "$url" set -l id (printf "%s\n" "$url" | sed 's|.*/||')
return 1
end
set -l id (printf "%s\n" $url | sed 's|.*/||')
set -l gists https://api.github.com/gists
set -l name ( set -l name (
curl -s $gists/$id | awk ' spin "curl -Ss https://api.github.com/gists/$id" | awk '
/"files": / { files++ } /"files": / { files++ }
@ -15,8 +10,7 @@ function __fisher_gist_to_name -a url
gsub("^ *\"|\.fish.*", "") gsub("^ *\"|\.fish.*", "")
print print
} }
'
' ^ /dev/null
) )
if test -z "$name" if test -z "$name"

View file

@ -1,3 +1,3 @@
function __fisher_help_parse function __fisher_help_parse
sed -nE 's/^ *(-(.))?,? *--([^ =]+) *(.*)$/\4;\3;\2/p' sed -nE 's/^ *(-(.))?,? *--([^ =[]+) *(.*)$/\4;\3;\2/p'
end end

View file

@ -1,3 +1,3 @@
function __fisher_key_bindings function __fisher_key_bindings
source $fisher_key_bindings ^ /dev/null source $fisher_binds ^ /dev/null
end end

View file

@ -1,15 +1,15 @@
function __fisher_key_bindings_disable -a plugin user_key_bindings function __fisher_key_bindings_disable -a plugin user_key_bindings
fish_indent < $fisher_key_bindings \ fish_indent < $fisher_binds \
| __fisher_key_bindings_undo $plugin \ | __fisher_key_bindings_undo $plugin \
| source | source
__fisher_key_bindings_delete $plugin \ __fisher_key_bindings_delete $plugin \
> $fisher_key_bindings.tmp \ > $fisher_binds.tmp \
< $fisher_key_bindings < $fisher_binds
command mv -f $fisher_key_bindings.tmp $fisher_key_bindings command mv -f $fisher_binds.tmp $fisher_binds
if test ! -s $fisher_key_bindings if test ! -s $fisher_binds
sed -i.tmp '/__fisher_key_bindings/d' $user_key_bindings sed -i.tmp '/__fisher_key_bindings/d' $user_key_bindings
command rm -f $user_key_bindings.tmp command rm -f $user_key_bindings.tmp
end end

View file

@ -1,5 +1,5 @@
function __fisher_key_bindings_enable -a plugin user_key_bindings function __fisher_key_bindings_enable -a plugin user_key_bindings
__fisher_key_bindings_update $plugin >> $fisher_key_bindings __fisher_key_bindings_update $plugin >> $fisher_binds
if test ! -s $user_key_bindings if test ! -s $user_key_bindings
command mkdir -p (dirname $user_key_bindings) command mkdir -p (dirname $user_key_bindings)

View file

@ -3,11 +3,12 @@ function __fisher_path_make -a path
pushd $path pushd $path
set -e argv[1] set -e argv[1]
if not make $argv if not make $argv
popd popd
return 1 return 1
end end
popd popd
end end
end end

View file

@ -1,4 +1,4 @@
function __fisher_path_update -a path function __fisher_path_update -a path
git -C $path checkout master --quiet ^ /dev/null git -C $path checkout master --quiet ^ /dev/null
git -C $path pull --rebase origin master --quiet ^ /dev/null git -C $path pull --rebase origin master --quiet
end end

View file

@ -7,13 +7,13 @@ function __fisher_plugin_walk -a plugin path
case \*/{fish_user_,}key_bindings.fish case \*/{fish_user_,}key_bindings.fish
printf "%s %s %s\n" --bind $file printf "%s %s %s\n" --bind $file
case \?\*/uninstall.fish case \*/uninstall.fish
printf "%s %s\n" --uninstall $file printf "%s %s\n" --uninstall $file
case \?\*/completions/\*.fish case \*/completions/\*.fish
printf "%s %s %s\n" --source $file completions/$base printf "%s %s %s\n" --source $file completions/$base
case \?\*/{conf.d,modules}/\?\* \?\*/\*config.fish \?\*/{before.,}init.fish \*/$plugin.load case \*/{conf.d,modules}/\?\* \*/\*config.fish \*/{before.,}init.fish \*/$plugin.load
switch "$base" switch "$base"
case \*$plugin\* case \*$plugin\*
case \* case \*

View file

@ -53,11 +53,11 @@ function fisher_install -d "Install Plugins"
switch "$item" switch "$item"
case https://gist.github.com\* case https://gist.github.com\*
if set -l name (wait "__fisher_gist_to_name $item") if set -l name (__fisher_gist_to_name $item)
printf "%s %s\n" $item $name printf "%s %s\n" $item $name
else else
set total (math $total - 1) set total (math $total - 1)
printf "fisher: '%s' is not a valid Gist or URL.\n" $item > $stderr printf "fisher: Repository '%s' not found.\n" $item > $stderr
end end
case \*/\* case \*/\*
@ -105,14 +105,7 @@ function fisher_install -d "Install Plugins"
if test -d "$url" if test -d "$url"
command ln -sfF $url $path command ln -sfF $url $path
else if not wait "__fisher_url_clone $url $path" else if not spin "__fisher_url_clone $url $path" --error=$stderr
printf "fisher: Repository not found: '%s'\n" $url > $stderr
switch "$url"
case \*oh-my-fish\*
printf "Did you miss a 'plugin-' or 'theme-' prefix?\n" > $stderr
end
continue continue
end end
end end
@ -120,7 +113,8 @@ function fisher_install -d "Install Plugins"
set -l deps (__fisher_deps_install "$path") set -l deps (__fisher_deps_install "$path")
if not __fisher_path_make "$path" --quiet if not __fisher_path_make "$path" --quiet
printf "fisher: Failed to build '%s'. See '%s/Makefile'.\n" $name $path > $stderr set total (math $total - 1)
continue
end end
__fisher_plugin_enable "$name" "$path" __fisher_plugin_enable "$name" "$path"

View file

@ -87,7 +87,7 @@ function fisher_search -d "Search Plugins"
end end
if test $fisher_last_update -gt $fisher_update_interval -o ! -f $index if test $fisher_last_update -gt $fisher_update_interval -o ! -f $index
if wait "__fisher_index_update" if spin "__fisher_index_update" --error=/dev/null
__fisher_complete_reset __fisher_complete_reset
end end
end end

View file

@ -36,21 +36,17 @@ function fisher_update -d "Update Plugins/Fisherman"
printf "Updating >> Fisherman\n" > $stderr printf "Updating >> Fisherman\n" > $stderr
if not wait "__fisher_index_update; __fisher_path_update $fisher_home" if not spin "
__fisher_index_update 0
__fisher_path_update $fisher_home" --error=$stderr
###
###
printf "fisher: Arrr! Could not update Fisherman.\n" > $stderr printf "fisher: Arrr! Could not update Fisherman.\n" > $stderr
sed -E 's/.*error: (.*)/\1/' $fisher_cache/.debug > $stderr
return 1 return 1
end end
#############################
## Remove before 1.0
set -g fisher_file $fisher_config/fishfile
if test ! -e $fisher_file
touch $fisher_file
end
## Remove before 1.0
#############################
printf "Aye! Fisherman updated to version %s (%0.fs)\n" ( printf "Aye! Fisherman updated to version %s (%0.fs)\n" (
cat $fisher_home/VERSION) (math (date +%s) - $time) > $stderr cat $fisher_home/VERSION) (math (date +%s) - $time) > $stderr
@ -92,10 +88,8 @@ function fisher_update -d "Update Plugins/Fisherman"
set index (math $index + 1) set index (math $index + 1)
end end
if not wait "__fisher_path_update $path" --log=$fisher_cache/.debug if test ! -L $path
if test ! -L $path if not spin "__fisher_path_update $path" --error=$stderr
sed -nE 's/.*(error|fatal): (.*)/error: \2/p
' $fisher_cache/.debug > $stderr
continue continue
end end
end end

3
functions/spin.fish Normal file
View file

@ -0,0 +1,3 @@
function spin -a commands
fish -c "$commands" ^ /dev/stderr
end

View file

@ -1,139 +0,0 @@
function wait -d "Run commands and display a spinner"
set -l log
set -l time 0.02
set -l option
set -l commands
set -l spinners
set -l format " @\r"
getopts $argv | while read -l 1 2
switch "$1"
case _
set commands $commands ";$2"
case s spin
set spinners $spinners $2
case t time
set time $2
case l log
set log $2
case f format
set format $2
case help
set option help
case h
printf "usage: wait <commands> [--spin=<style>] [--time=<delay>] [--log=<file>] \n"
printf " [--format=<format>] [--help]\n\n"
printf " -s --spin=<style> Set spinner style\n"
printf " -t --time=<delay> Set spinner transition time delay\n"
printf " -l --log=<file> Output standard error to <file>\n"
printf " -f --format=<format> Use given <format> to display spinner\n"
printf " -h --help Show usage help\n"
return
case \*
printf "wait: '%s' is not a valid option\n" $1 > /dev/stderr
wait -h > /dev/stderr
return 1
end
end
switch "$option"
case help
man wait
return
end
if not set -q commands[1]
return 1
end
if not set -q spinners[1]
set spinners mixer
end
switch "$spinners"
case arc star pipe ball flip mixer caret
set -l arc "◜◠◝◞◡◟"
set -l star "+x*"
set -l pipe "|/--\\"
set -l ball "▖▘▝▗"
set -l flip "___-``'´-___"
set -l mixer "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"
set -l caret "II||"
set spinners "$$spinners"
case bar{1,2,3}
set -l bar
set -l bar1 "[" "=" " " "]" "%"
set -l bar2 "[" "#" " " "]" "%"
set -l bar3 "." "." " " " " "%"
set -l open $$spinners[1][1]
set -l fill $$spinners[1][2]
set -l void $$spinners[1][3]
set -l close $$spinners[1][4]
set -l symbol $$spinners[1][5]
set spinners
for i in (seq 5 5 100)
if test -n "$symbol"
set symbol "$i%"
end
set -l gap (printf "$void%.0s" (seq (math 100 - $i)))
if test $i -ge 100
set gap ""
end
set spinners $spinners "$open"(printf "$fill%.0s" (seq $i))"$gap$close $symbol"
end
end
set -l tmp (mktemp -t wait.XXX)
fish -c "$commands" ^ $tmp &
if not set -q spinners[2]
set spinners (printf "%s\n" "$spinners" | grep -o .)
end
while true
if status --is-interactive
for i in $spinners
printf "$format" | awk -v i=(printf "%s\n" $i | sed 's/=/\\\=/') '
{
gsub("@", i)
printf("%s", $0)
}
' > /dev/stderr
sleep $time
end
end
if test -z (jobs)
break
end
end
if test -s $tmp
if test ! -z "$log"
nl -n command ln -- $tmp > $log
end
command rm -f $tmp
return 1
end
command rm -f $tmp
end

View file

@ -91,37 +91,10 @@ fisher install \.
Fisherman was created by Jorge Bucaran \fIj@bucaran\.me\fR\. Fisherman was created by Jorge Bucaran \fIj@bucaran\.me\fR\.
. .
.P .P
See AUTHORS file for the complete list of contributors\. See THANKS file for the complete list of contributors\.
. .
.SH "SEE ALSO" .SH "SEE ALSO"
fisher help tour fisher help tour
. .
.br .br
fisher help help
.
.br
fisher help update
.
.br
fisher help search
.
.br
fisher help config
.
.br
fisher help install
.
.br
fisher help plugins
.
.br
fisher help commands
.
.br
fisher help fishfile
.
.br
fisher help uninstall
.
.br

View file

@ -52,17 +52,8 @@ fisher install .
Fisherman was created by Jorge Bucaran *j@bucaran.me*. Fisherman was created by Jorge Bucaran *j@bucaran.me*.
See AUTHORS file for the complete list of contributors. See THANKS file for the complete list of contributors.
## SEE ALSO ## SEE ALSO
fisher help tour<br> fisher help tour<br>
fisher help help<br>
fisher help update<br>
fisher help search<br>
fisher help config<br>
fisher help install<br>
fisher help plugins<br>
fisher help commands<br>
fisher help fishfile<br>
fisher help uninstall<br>

View file

@ -1,105 +0,0 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "WAIT" "1" "February 2016" "" "fisherman"
.
.SH "NAME"
\fBwait\fR \- Run commands and wait with a spin
.
.SH "SYNOPSIS"
\fBwait\fR \fIcommands\fR [\fB\-\-spin\fR=\fIarc\fR|\fIstar\fR|\fIpipe\fR|\fIball\fR|\fIflip\fR|\fImixer\fR|\fIcaret\fR|\fIbar1~3\fR]
.
.br
\fBwait\fR \fIcommands\fR [\fB\-\-time\fR=interval] [\fB\-\-log\fR=file] [\fB\-\-format\fR=format] [\fB\-\-help\fR]
.
.SH "DESCRIPTION"
Run \fIcommands\fR in the background and wait until the job has finished\. Any output to standard error indicates \fBwait\fR to return \fB1\fR\. While it waits, a customizable spinner is displayed in the command line\.
.
.SH "OPTIONS"
.
.TP
\fB\-s \-\-spin=style|string\fR
Set the spinner style\. See \fBStyles\fR for styles and details on how to customize the spinner tokens\.
.
.TP
\fB\-t \-\-time=interval\fR
Set spinner transition time delay in \fIseconds\fR\. A large value will refresh the spinner more slowly\. You may use decimal numbers to represent smaller numbers\. The default interval is \fB0\.02\fR\.
.
.TP
\fB\-l \-\-log=file\fR
Write the standard error output to a given \fIfile\fR\.
.
.TP
\fB\-f \-\-format=format\fR
Use the given \fIformat\fR to display the spinner\. The default format is \fB"\er@"\fR where \fB@\fR represents the spinner token and \fB\er\fR a carriage return, used to refresh (erase) the line\.
.
.TP
\fB\-h \-\-help\fR
Show usage help\.
.
.SH "STYLES"
.
.IP "\(bu" 4
arc, star, pipe, ball, flip, mixer, caret
.
.IP "\(bu" 4
bar1~3
.
.IP "" 0
.
.P
If no style is given, \fBmixer\fR is used by default\. If you don\'t want to display any spinners, use \fB\-\-spin=""\fR\.
.
.SS "CUSTOMIZATION"
In addition to the default styles, you can specify a string of character tokens to be used each per spinner refresh cycle\.
.
.P
For example \fB\-\-spin=12345\fR will display the numbers from 1 to 5, and \fB\-\-spin=\. \-\-format=@\fR an increasing sequence of dots\.
.
.SS "PROGRESS BARS"
Display a progress bar with a percent indicator using \fB\-\-spin=bar1~3\fR:
.
.IP "\(bu" 4
bar1: [=====] \fInum\fR%
.
.IP "\(bu" 4
bar2: [#####] \fInum\fR%
.
.IP "\(bu" 4
bar3: \.\.\.\.\.\.\. \fInum\fR%
.
.IP "" 0
.
.SH "EXAMPLES"
Run commands in the background and display a spinning pipe while until finished\.
.
.IP "" 4
.
.nf
wait \-\-spin=pipe "curl \-sS $URL"
.
.fi
.
.IP "" 0
.
.P
Write the standard error output to \fIdebug\.txt\fR\.
.
.IP "" 4
.
.nf
if not wait \-\-spin=pipe \-\-log=debug\.txt "curl \-sS $URL"
return 1
end
.
.fi
.
.IP "" 0
.
.SH "SEE ALSO"
sleep(1)
.
.br

View file

@ -1,69 +0,0 @@
wait(1) -- Run commands and wait with a spin
============================================
## SYNOPSIS
`wait` *commands* [`--spin`=*arc*|*star*|*pipe*|*ball*|*flip*|*mixer*|*caret*|*bar1~3*]<br>
`wait` *commands* [`--time`=interval] [`--log`=file] [`--format`=format] [`--help`]
## DESCRIPTION
Run *commands* in the background and wait until the job has finished. Any output to standard error indicates `wait` to return `1`. While it waits, a customizable spinner is displayed in the command line.
## OPTIONS
* `-s --spin=style|string`:
Set the spinner style. See `Styles` for styles and details on how to customize the spinner tokens.
* `-t --time=interval`:
Set spinner transition time delay in *seconds*. A large value will refresh the spinner more slowly. You may use decimal numbers to represent smaller numbers. The default interval is `0.02`.
* `-l --log=file`:
Write the standard error output to a given *file*.
* `-f --format=format`:
Use the given *format* to display the spinner. The default format is `"\r@"` where `@` represents the spinner token and `\r` a carriage return, used to refresh (erase) the line.
* `-h --help`:
Show usage help.
## STYLES
* arc, star, pipe, ball, flip, mixer, caret
* bar1~3
If no style is given, `mixer` is used by default. If you don't want to display any spinners, use `--spin=""`.
### CUSTOMIZATION
In addition to the default styles, you can specify a string of character tokens to be used each per spinner refresh cycle.
For example `--spin=12345` will display the numbers from 1 to 5, and `--spin=. --format=@` an increasing sequence of dots.
### PROGRESS BARS
Display a progress bar with a percent indicator using `--spin=bar1~3`:
* bar1: [=====] *num*%
* bar2: [#####] *num*%
* bar3: ....... *num*%
## EXAMPLES
Run commands in the background and display a spinning pipe while until finished.
```
wait --spin=pipe "curl -sS $URL"
```
Write the standard error output to *debug.txt*.
```
if not wait --spin=pipe --log=debug.txt "curl -sS $URL"
return 1
end
```
## SEE ALSO
sleep(1)<br>

View file

@ -13,12 +13,6 @@ This document describes how to use Fisherman configuration variables\.
Your fish user configuration, usually located in \fB$XDG_CONFIG_HOME/fish/config\.fish\fR is updated after installing Fisherman to add the global variables \fB$fisher_home\fR and \fB$fisher_config\fR\. Your fish user configuration, usually located in \fB$XDG_CONFIG_HOME/fish/config\.fish\fR is updated after installing Fisherman to add the global variables \fB$fisher_home\fR and \fB$fisher_config\fR\.
. .
.P .P
\fB$fisher_home\fR is the directory where Fisherman is downloaded to a
.
.P
\fB$fisher_config\fR is the user configuration directory and the
.
.P
Using the following variables, you can customize the locations of the cache, index URL, fishfile, create command aliases, etc\. Using the following variables, you can customize the locations of the cache, index URL, fishfile, create command aliases, etc\.
. .
.SH "VARIABLES" .SH "VARIABLES"
@ -33,7 +27,7 @@ The user configuration directory\. This is default location of your user \fIfish
. .
.TP .TP
\fB$fisher_file\fR \fB$fisher_file\fR
This file keeps a list of what plugins you have installed and are currently enabled\. \fB$fisher_cofig/fishfile\fR by default\. See \fBfisher help fishfile\fR for details\. This file keeps a list of what plugins you have installed and are currently enabled\. \fB$fisher_config/fishfile\fR by default\. See \fBfisher help fishfile\fR for details\.
. .
.TP .TP
\fB$fisher_cache\fR \fB$fisher_cache\fR

View file

@ -9,10 +9,6 @@ This document describes how to use Fisherman configuration variables.
Your fish user configuration, usually located in `$XDG_CONFIG_HOME/fish/config.fish` is updated after installing Fisherman to add the global variables `$fisher_home` and `$fisher_config`. Your fish user configuration, usually located in `$XDG_CONFIG_HOME/fish/config.fish` is updated after installing Fisherman to add the global variables `$fisher_home` and `$fisher_config`.
`$fisher_home` is the directory where Fisherman is downloaded to a
`$fisher_config` is the user configuration directory and the
Using the following variables, you can customize the locations of the cache, index URL, fishfile, create command aliases, etc. Using the following variables, you can customize the locations of the cache, index URL, fishfile, create command aliases, etc.
## VARIABLES ## VARIABLES

View file

@ -110,7 +110,7 @@ See \fB$fisher_home/config\.fish\fR for the full code\.
.SS "How is Fisherman faster than Oh My Fish and other systems?" .SS "How is Fisherman faster than Oh My Fish and other systems?"
Fisherman ameliorates the slow shell start problem using a flat dependency tree instead of loading a directory hierarchy per plugin\. This also means that Fisherman performance does not decline depending on the number of plugins installed\. See also \fBFlat Tree\fR in \fBfisher help tour\fR\. Fisherman ameliorates the slow shell start problem using a flat dependency tree instead of loading a directory hierarchy per plugin\. This also means that Fisherman performance does not decline depending on the number of plugins installed\. See also \fBFlat Tree\fR in \fBfisher help tour\fR\.
. .
.SS "How can I upgrade from an existing Oh My Fish or Wahoo installation?" .SS "How can I upgrade from an existing Oh My Fish! installation?"
Remove the \fB$OMF_PATH\fR and \fB$OMF_CONFIG\fR variables from your \fBconfig\.fish\fR\. Remove the \fB$OMF_PATH\fR and \fB$OMF_CONFIG\fR variables from your \fBconfig\.fish\fR\.
. .
.P .P

View file

@ -79,7 +79,7 @@ See `$fisher_home/config.fish` for the full code.
Fisherman ameliorates the slow shell start problem using a flat dependency tree instead of loading a directory hierarchy per plugin. This also means that Fisherman performance does not decline depending on the number of plugins installed. See also `Flat Tree` in `fisher help tour`. Fisherman ameliorates the slow shell start problem using a flat dependency tree instead of loading a directory hierarchy per plugin. This also means that Fisherman performance does not decline depending on the number of plugins installed. See also `Flat Tree` in `fisher help tour`.
### How can I upgrade from an existing Oh My Fish or Wahoo installation? ### How can I upgrade from an existing Oh My Fish! installation?
Remove the `$OMF_PATH` and `$OMF_CONFIG` variables from your `config.fish`. Remove the `$OMF_PATH` and `$OMF_CONFIG` variables from your `config.fish`.

View file

@ -293,7 +293,7 @@ If you are already familiar with other UNIX tools, you\'ll find Fisherman comman
Most commands read the standard input by default when no options are given and produce easy to parse output, making Fisherman commands ideal for plumbing and building upon each other\. Most commands read the standard input by default when no options are given and produce easy to parse output, making Fisherman commands ideal for plumbing and building upon each other\.
. .
.P .P
Fisherman also ships with a CLI options parser and a background job wait spinner that you can use to implement your own commands CLI\. See \fBgetopts(1)\fR and \fBwait(1)\fR\. Fisherman also ships with a CLI options parser and a background job spinner that you can use to implement your own commands CLI\. See \fBgetopts(1)\fR and \fBspin(1)\fR\.
. .
.SH "COMPATIBILITY" .SH "COMPATIBILITY"
Fisherman supports Oh My Fish! themes and plugins, but some features are turned off by default for performance reasons\. Fisherman supports Oh My Fish! themes and plugins, but some features are turned off by default for performance reasons\.
@ -336,10 +336,9 @@ fisher help plugins
fisher help commands fisher help commands
. .
.br .br
wait(1) spin(1)
. .
.br .br
getopts(1) getopts(1)
. .
.br .br

View file

@ -178,7 +178,7 @@ If you are already familiar with other UNIX tools, you'll find Fisherman command
Most commands read the standard input by default when no options are given and produce easy to parse output, making Fisherman commands ideal for plumbing and building upon each other. Most commands read the standard input by default when no options are given and produce easy to parse output, making Fisherman commands ideal for plumbing and building upon each other.
Fisherman also ships with a CLI options parser and a background job wait spinner that you can use to implement your own commands CLI. See `getopts(1)` and `wait(1)`. Fisherman also ships with a CLI options parser and a job spinner you can use to implement your own CLIs. See `getopts(1)` and `spin(1)`.
## COMPATIBILITY ## COMPATIBILITY
@ -203,5 +203,5 @@ fisher help<br>
fisher help config<br> fisher help config<br>
fisher help plugins<br> fisher help plugins<br>
fisher help commands<br> fisher help commands<br>
wait(1)<br> spin(1)<br>
getopts(1)<br> getopts(1)<br>

View file

@ -27,7 +27,7 @@ test "$TESTNAME - Define fishfile in \$fisher_config/fishfile (default)"
end end
test "$TESTNAME - Define key bindings in \$fisher_config/key_bindings.fish (default)" test "$TESTNAME - Define key bindings in \$fisher_config/key_bindings.fish (default)"
$fisher_key_bindings = $path/key_bindings.fish $fisher_binds = $path/key_bindings.fish
end end
test "$TESTNAME - Add Fisherman config/functions to the head of \$fish_function_path" test "$TESTNAME - Add Fisherman config/functions to the head of \$fish_function_path"

View file

@ -1,5 +1,5 @@
# This is how a plugin can declare key bindings. # This is how a plugin can declare key bindings.
# The functin may also be called fisher_key_bindings. # The functin may also be called fisher_binds.
# You can also simply expose the key bindings without a function. # You can also simply expose the key bindings without a function.
function key_bindings function key_bindings

View file

@ -1,13 +1,13 @@
set -g gist $DIRNAME/fixtures/gist set -g gist $DIRNAME/fixtures/gist
function -S setup function -S setup
function -S curl -a flags url function -S spin -a url
cat $gist/(basename $url).json cat $gist/(basename $url).json ^ /dev/null
end end
end end
function -S teardown function -S teardown
functions -e curl functions -e spin
end end
test "$TESTNAME - Fail if URL is an empty string" test "$TESTNAME - Fail if URL is an empty string"
@ -17,6 +17,10 @@ test "$TESTNAME - Fail if URL is an empty string"
) )
end end
test "$TESTNAME - Fail if URL is invalid"
-z (__fisher_gist_to_name gist.github.com/bar)
end
test "$TESTNAME - Retrieve the name of the first *.fish file in the JSON stream" test "$TESTNAME - Retrieve the name of the first *.fish file in the JSON stream"
foo = (__fisher_gist_to_name gist.github.com/foo) foo = (__fisher_gist_to_name gist.github.com/foo)
end end

View file

@ -1 +1 @@
functions -e __fisher_url_clone wait functions -e __fisher_url_clone spin

View file

@ -13,6 +13,6 @@ function -S __fisher_url_clone -a url path
cp -rf (echo $url | sed "s|https://github.com/|$plugins/|") $path cp -rf (echo $url | sed "s|https://github.com/|$plugins/|") $path
end end
function wait function spin
eval $argv eval $argv
end end

View file

@ -5,7 +5,7 @@ function -S setup
mkdir -p $path mkdir -p $path
cp $DIRNAME/fixtures/key-bindings/*.fish $path cp $DIRNAME/fixtures/key-bindings/*.fish $path
set -g fisher_key_bindings $path/fisher_key_bindings.fish set -g fisher_binds $path/fisher_key_bindings.fish
for plugin in foo bar baz for plugin in foo bar baz
__fisher_key_bindings_disable $plugin $path/user_key_bindings.fish >> $path/key_bindings_log __fisher_key_bindings_disable $plugin $path/user_key_bindings.fish >> $path/key_bindings_log

View file

@ -4,7 +4,7 @@ set -l fixtures $DIRNAME/fixtures/key-bindings/update
function -S setup function -S setup
mkdir -p $path mkdir -p $path
set -g fisher_key_bindings $path/fisher_key_bindings.fish set -g fisher_binds $path/key_bindings.fish
__fisher_key_bindings_enable \ __fisher_key_bindings_enable \
norf $path/norf/norf.fish \ norf $path/norf/norf.fish \
@ -19,6 +19,6 @@ test "$TESTNAME - Create fish_user_key_bindings calling to __fisher_key_bindings
(functions fish_user_key_bindings | xargs) = (cat $path/norf/norf.fish | xargs) (functions fish_user_key_bindings | xargs) = (cat $path/norf/norf.fish | xargs)
end end
test "$TESTNAME - Add plugin bindingss to \$fisher_key_bindings" test "$TESTNAME - Add plugin bindingss to \$fisher_binds"
(cat $fisher_key_bindings | xargs) = "##norf## foo bar baz ##norf##" (cat $fisher_binds | xargs) = "##norf## foo bar baz ##norf##"
end end

View file

@ -1,5 +1,5 @@
# We use key-bindings-update to extract a plugin's declared key bindings and # We use key-bindings-update to extract a plugin's declared key bindings and
# append them to $fisher_key_bindings. # append them to $fisher_binds.
set -l path $DIRNAME/fixtures/key-bindings/update set -l path $DIRNAME/fixtures/key-bindings/update

View file

@ -3,9 +3,9 @@ set -l path $DIRNAME/.t-$TESTNAME-(random)
function -S setup function -S setup
mkdir -p $path mkdir -p $path
set -g fisher_key_bindings $path/key_bindings.fish set -g fisher_binds $path/key_bindings.fish
echo echo ok > $fisher_key_bindings echo echo ok > $fisher_binds
end end
function -S teardown function -S teardown

View file

@ -8,14 +8,14 @@ function -S setup
__fisher_index_update __fisher_index_update
function wait function spin -a commands
eval $argv eval "$commands"
end end
end end
function -S teardown function -S teardown
rm -rf $path rm -rf $path
functions -e wait functions -e spin
end end
test "$TESTNAME - Get only names from index" test "$TESTNAME - Get only names from index"

View file

@ -6,7 +6,7 @@ function -S setup
source $DIRNAME/helpers/config-mock.fish $path/config source $DIRNAME/helpers/config-mock.fish $path/config
function __fisher_path_update function __fisher_path_update
echo "$argv" echo "$argv[1]"
end end
fisher install foo --quiet fisher install foo --quiet
@ -21,9 +21,9 @@ function -S teardown
end end
test "$TESTNAME - Update plugin path" test "$TESTNAME - Update plugin path"
(cat $path/foo) = "$path/config/cache/foo --log=$path/config/cache/.debug" (cat $path/foo) = "$path/config/cache/foo"
end end
test "$TESTNAME - Update index and Fisherman's home" test "$TESTNAME - Update Index and \$fisher_home"
(cat $path/self) = $fisher_home (cat $path/self) = $fisher_home
end end

View file

@ -1,21 +0,0 @@
test "$TESTNAME: Fail if no commands are given"
1 = (
wait
echo $status
)
end
test "$TESTNAME - Fail if there is any output to standard error" (
if not wait 'echo error >&2'
echo ok
end
) = ok
end
test "$TESTNAME - Run commands in the background"
(wait "math 1 + 2") = 3
end
test "$TESTNAME - Display help information"
(wait -h | xargs) = "usage: wait <commands> [--spin=<style>] [--time=<delay>] [--log=<file>] [--format=<format>] [--help] -s --spin=<style> Set spinner style -t --time=<delay> Set spinner transition time delay -l --log=<file> Output standard error to <file> -f --format=<format> Use given <format> to display spinner -h --help Show usage help"
end