mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
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:
parent
4c0ddb1b28
commit
692bb22db6
45 changed files with 139 additions and 544 deletions
|
@ -4,4 +4,4 @@ before_install:
|
|||
- sudo apt-get update
|
||||
- sudo apt-get -y install fish
|
||||
script:
|
||||
- make && fish -c "fisher install fishtape; fishtape test/*.fish"
|
||||
- make && fish -c "__fisher_index_update; fisher_install fishtape; fishtape test/*.fish"
|
||||
|
|
|
@ -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)>
|
29
CHANGELOG.md
29
CHANGELOG.md
|
@ -1,5 +1,21 @@
|
|||
# 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
|
||||
|
||||
* 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`.
|
||||
|
||||
* **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.
|
||||
|
||||
|
@ -36,7 +52,6 @@
|
|||
|
||||
* Create empty fishfile during make install.
|
||||
|
||||
|
||||
## [0.5.0][v050] - 2016-02-02
|
||||
|
||||
* **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 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.
|
||||
|
@ -92,7 +106,6 @@
|
|||
|
||||
+ Prepend `*` to plugin names to indicate they are currently enabled when using `fisher --list[=cache]`. See #49.
|
||||
|
||||
|
||||
## [0.4.0][v040] - 2016-01-11
|
||||
|
||||
* 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.
|
||||
|
||||
|
||||
## [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.
|
||||
|
@ -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 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.
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
||||
## [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.
|
||||
|
@ -238,14 +249,10 @@
|
|||
|
||||
* Refactor and improve tests for `install`, `update` and `uninstall`.
|
||||
|
||||
|
||||
## [0.1.0][v010] - 2016-01-01
|
||||
|
||||
* Initial commit.
|
||||
|
||||
|
||||
:anchor:
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
[v100]: https://github.com/fisherman/fisherman/releases/tag/1.0.0
|
||||
|
|
51
Makefile
51
Makefile
|
@ -15,38 +15,24 @@ MAN7 := $(wildcard $(MAN)/man7/*.md)
|
|||
DOCS := $(MAN1:%.md=%.1) $(MAN5:%.md=%.5) $(MAN7:%.md=%.7)
|
||||
|
||||
INDEX := $(FISHER_CACHE)/.index
|
||||
|
||||
AUTHORS = $(FISHER_HOME)/AUTHORS.md
|
||||
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
|
||||
|
||||
all: $(FISH_CONFIG) $(FISHER_CACHE) $(FISHER_FILE) $(AUTHORS) $(DOCS)
|
||||
@if [ ! -s $(INDEX) ]; then\
|
||||
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'
|
||||
all: $(FISH_CONFIG) $(FISHER_CACHE) $(FISHER_FILE) $(DOCS)
|
||||
@echo "** Reload your shell and type 'fisher' to get started **"
|
||||
|
||||
test:
|
||||
@fish -c "fishtape test/*.fish"
|
||||
|
||||
flush:
|
||||
@rm -rf $(FISHER_CONFIG)/*
|
||||
fish -c "fishtape test/*.fish"
|
||||
|
||||
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
|
||||
@mv $(FISH_CONFIG).tmp $(FISH_CONFIG)
|
||||
@$(call MSG,"Reset your shell to apply changes.")
|
||||
mv $(FISH_CONFIG).tmp $(FISH_CONFIG)
|
||||
$(call MSG,"Reload your shell to apply changes.")
|
||||
|
||||
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)";\
|
||||
sed "s/latest-v.\..\..-00B9FF/latest-v$(VERSION)-00B9FF/" $^/README.md > $^/README.md.swap;\
|
||||
mv $^/README.md.swap $^/README.md;\
|
||||
|
@ -59,25 +45,18 @@ release: $(FISHER_HOME)
|
|||
fi
|
||||
|
||||
$(FISH_CONFIG):
|
||||
@echo "Adding configuration to $@" | $(TILDEIFY)
|
||||
@mkdir -p $(dir $@) && touch $@
|
||||
@echo "set fisher_home $(FISHER_HOME)" | sed "s|/$$||;s|$$HOME|~|" > $@.fisher
|
||||
@echo "set fisher_config $(FISHER_CONFIG)" | sed "s|$$HOME|~|" >> $@.fisher
|
||||
@echo "source \$$fisher_home/config.fish" >> $@.fisher
|
||||
@awk 'FNR==NR{ print; a[$$0]; next } !($$0 in a) || /^$$/' $@.fisher $@ > $@.tmp
|
||||
@mv $@.tmp $@ && rm $@.fisher
|
||||
mkdir -p $(dir $@) && touch $@
|
||||
echo "set fisher_home $(FISHER_HOME)" | sed "s|/$$||;s|$$HOME|~|" > $@.fisher
|
||||
echo "set fisher_config $(FISHER_CONFIG)" | sed "s|$$HOME|~|" >> $@.fisher
|
||||
echo "source \$$fisher_home/config.fish" >> $@.fisher
|
||||
awk 'FNR==NR{ print; a[$$0]; next } !($$0 in a) || /^$$/' $@.fisher $@ > $@.tmp
|
||||
mv $@.tmp $@ && rm $@.fisher
|
||||
|
||||
$(FISHER_CACHE):
|
||||
@[ -d $@ ] || echo "Creating $@" | $(TILDEIFY)
|
||||
@mkdir -p $@
|
||||
mkdir -p $@
|
||||
|
||||
$(FISHER_FILE):
|
||||
@touch $@
|
||||
|
||||
$(AUTHORS): $(FISHER_HOME)
|
||||
@echo "# Authors" > $@
|
||||
@git -C $^ shortlog -sne | cut -f2- | \
|
||||
sed -E 's/([^<>]+)<([^<>]*)>/* \1 \<[\2](mailto:\2)\>/' >> $@
|
||||
touch $@
|
||||
|
||||
%.1 %.5 %.7: %.md
|
||||
-@if type ronn 2>/dev/null 1>&2; then \
|
||||
|
|
12
THANKS.md
Normal file
12
THANKS.md
Normal 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:
|
|
@ -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 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 -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"
|
||||
|
@ -25,6 +27,10 @@ for option in commands guides
|
|||
end
|
||||
end
|
||||
|
||||
if test ! -e $fisher_cache/.index
|
||||
exit
|
||||
end
|
||||
|
||||
set -l plugins (
|
||||
if test -s $fisher_file
|
||||
__fisher_file < $fisher_file | __fisher_name
|
||||
|
@ -32,7 +38,6 @@ set -l plugins (
|
|||
)
|
||||
|
||||
begin
|
||||
|
||||
awk -F '\n' -v RS='' -v OFS=';' '/^ *#/ { next } { print $1, $3 }' $fisher_cache/.index
|
||||
__fisher_cache_list
|
||||
|
||||
|
@ -43,7 +48,4 @@ end | sort -ut ';' -k1,1 | while read -l name info
|
|||
else
|
||||
complete -c fisher -n "__fish_seen_subcommand_from i install" -a "$name" -d "$info"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
complete -c fisher -n "__fish_seen_subcommand_from update" -a "fisherman" -d "Update Fisherman"
|
||||
|
|
|
@ -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
|
|
@ -1,6 +1,6 @@
|
|||
set -g fisher_file $fisher_config/fishfile
|
||||
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_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path
|
||||
|
|
|
@ -13,7 +13,7 @@ function __fisher_file
|
|||
}
|
||||
|
||||
!/^[ \t]*(#.*)*$/ {
|
||||
gsub("^[|*>]|#.*", "")
|
||||
gsub("^[@*>]|#.*", "")
|
||||
|
||||
if (! seen[$1]++) {
|
||||
printf("%s\n", $1)
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
function __fisher_gist_to_name -a url
|
||||
if test -z "$url"
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l id (printf "%s\n" $url | sed 's|.*/||')
|
||||
set -l gists https://api.github.com/gists
|
||||
set -l id (printf "%s\n" "$url" | sed 's|.*/||')
|
||||
|
||||
set -l name (
|
||||
curl -s $gists/$id | awk '
|
||||
spin "curl -Ss https://api.github.com/gists/$id" | awk '
|
||||
|
||||
/"files": / { files++ }
|
||||
|
||||
|
@ -15,8 +10,7 @@ function __fisher_gist_to_name -a url
|
|||
gsub("^ *\"|\.fish.*", "")
|
||||
print
|
||||
}
|
||||
|
||||
' ^ /dev/null
|
||||
'
|
||||
)
|
||||
|
||||
if test -z "$name"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
function __fisher_help_parse
|
||||
sed -nE 's/^ *(-(.))?,? *--([^ =]+) *(.*)$/\4;\3;\2/p'
|
||||
sed -nE 's/^ *(-(.))?,? *--([^ =[]+) *(.*)$/\4;\3;\2/p'
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
function __fisher_key_bindings
|
||||
source $fisher_key_bindings ^ /dev/null
|
||||
source $fisher_binds ^ /dev/null
|
||||
end
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
function __fisher_key_bindings_disable -a plugin user_key_bindings
|
||||
fish_indent < $fisher_key_bindings \
|
||||
fish_indent < $fisher_binds \
|
||||
| __fisher_key_bindings_undo $plugin \
|
||||
| source
|
||||
|
||||
__fisher_key_bindings_delete $plugin \
|
||||
> $fisher_key_bindings.tmp \
|
||||
< $fisher_key_bindings
|
||||
> $fisher_binds.tmp \
|
||||
< $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
|
||||
command rm -f $user_key_bindings.tmp
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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
|
||||
command mkdir -p (dirname $user_key_bindings)
|
||||
|
|
|
@ -8,6 +8,7 @@ function __fisher_path_make -a path
|
|||
popd
|
||||
return 1
|
||||
end
|
||||
|
||||
popd
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function __fisher_path_update -a path
|
||||
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
|
||||
|
|
|
@ -7,13 +7,13 @@ function __fisher_plugin_walk -a plugin path
|
|||
case \*/{fish_user_,}key_bindings.fish
|
||||
printf "%s %s %s\n" --bind $file
|
||||
|
||||
case \?\*/uninstall.fish
|
||||
case \*/uninstall.fish
|
||||
printf "%s %s\n" --uninstall $file
|
||||
|
||||
case \?\*/completions/\*.fish
|
||||
case \*/completions/\*.fish
|
||||
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"
|
||||
case \*$plugin\*
|
||||
case \*
|
||||
|
|
|
@ -53,11 +53,11 @@ function fisher_install -d "Install Plugins"
|
|||
|
||||
switch "$item"
|
||||
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
|
||||
else
|
||||
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
|
||||
|
||||
case \*/\*
|
||||
|
@ -105,14 +105,7 @@ function fisher_install -d "Install Plugins"
|
|||
if test -d "$url"
|
||||
command ln -sfF $url $path
|
||||
|
||||
else if not wait "__fisher_url_clone $url $path"
|
||||
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
|
||||
|
||||
else if not spin "__fisher_url_clone $url $path" --error=$stderr
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
@ -120,7 +113,8 @@ function fisher_install -d "Install Plugins"
|
|||
set -l deps (__fisher_deps_install "$path")
|
||||
|
||||
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
|
||||
|
||||
__fisher_plugin_enable "$name" "$path"
|
||||
|
|
|
@ -87,7 +87,7 @@ function fisher_search -d "Search Plugins"
|
|||
end
|
||||
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,21 +36,17 @@ function fisher_update -d "Update Plugins/Fisherman"
|
|||
|
||||
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
|
||||
sed -E 's/.*error: (.*)/\1/' $fisher_cache/.debug > $stderr
|
||||
return 1
|
||||
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" (
|
||||
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)
|
||||
end
|
||||
|
||||
if not wait "__fisher_path_update $path" --log=$fisher_cache/.debug
|
||||
if test ! -L $path
|
||||
sed -nE 's/.*(error|fatal): (.*)/error: \2/p
|
||||
' $fisher_cache/.debug > $stderr
|
||||
if not spin "__fisher_path_update $path" --error=$stderr
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
|
3
functions/spin.fish
Normal file
3
functions/spin.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function spin -a commands
|
||||
fish -c "$commands" ^ /dev/stderr
|
||||
end
|
|
@ -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
|
|
@ -91,37 +91,10 @@ fisher install \.
|
|||
Fisherman was created by Jorge Bucaran \fIj@bucaran\.me\fR\.
|
||||
.
|
||||
.P
|
||||
See AUTHORS file for the complete list of contributors\.
|
||||
See THANKS file for the complete list of contributors\.
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
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
|
||||
|
||||
|
|
|
@ -52,17 +52,8 @@ fisher install .
|
|||
|
||||
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
|
||||
|
||||
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>
|
||||
|
|
105
man/man1/wait.1
105
man/man1/wait.1
|
@ -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
|
||||
|
|
@ -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>
|
|
@ -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\.
|
||||
.
|
||||
.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\.
|
||||
.
|
||||
.SH "VARIABLES"
|
||||
|
@ -33,7 +27,7 @@ The user configuration directory\. This is default location of your user \fIfish
|
|||
.
|
||||
.TP
|
||||
\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
|
||||
\fB$fisher_cache\fR
|
||||
|
|
|
@ -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`.
|
||||
|
||||
`$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.
|
||||
|
||||
## VARIABLES
|
||||
|
|
|
@ -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?"
|
||||
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\.
|
||||
.
|
||||
.P
|
||||
|
|
|
@ -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`.
|
||||
|
||||
### 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`.
|
||||
|
||||
|
|
|
@ -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\.
|
||||
.
|
||||
.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"
|
||||
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
|
||||
.
|
||||
.br
|
||||
wait(1)
|
||||
spin(1)
|
||||
.
|
||||
.br
|
||||
getopts(1)
|
||||
.
|
||||
.br
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
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
|
||||
|
||||
|
@ -203,5 +203,5 @@ fisher help<br>
|
|||
fisher help config<br>
|
||||
fisher help plugins<br>
|
||||
fisher help commands<br>
|
||||
wait(1)<br>
|
||||
spin(1)<br>
|
||||
getopts(1)<br>
|
||||
|
|
|
@ -27,7 +27,7 @@ test "$TESTNAME - Define fishfile in \$fisher_config/fishfile (default)"
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
test "$TESTNAME - Add Fisherman config/functions to the head of \$fish_function_path"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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.
|
||||
|
||||
function key_bindings
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
set -g gist $DIRNAME/fixtures/gist
|
||||
|
||||
function -S setup
|
||||
function -S curl -a flags url
|
||||
cat $gist/(basename $url).json
|
||||
function -S spin -a url
|
||||
cat $gist/(basename $url).json ^ /dev/null
|
||||
end
|
||||
end
|
||||
|
||||
function -S teardown
|
||||
functions -e curl
|
||||
functions -e spin
|
||||
end
|
||||
|
||||
test "$TESTNAME - Fail if URL is an empty string"
|
||||
|
@ -17,6 +17,10 @@ test "$TESTNAME - Fail if URL is an empty string"
|
|||
)
|
||||
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"
|
||||
foo = (__fisher_gist_to_name gist.github.com/foo)
|
||||
end
|
||||
|
|
|
@ -1 +1 @@
|
|||
functions -e __fisher_url_clone wait
|
||||
functions -e __fisher_url_clone spin
|
||||
|
|
|
@ -13,6 +13,6 @@ function -S __fisher_url_clone -a url path
|
|||
cp -rf (echo $url | sed "s|https://github.com/|$plugins/|") $path
|
||||
end
|
||||
|
||||
function wait
|
||||
function spin
|
||||
eval $argv
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ function -S setup
|
|||
mkdir -p $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
|
||||
__fisher_key_bindings_disable $plugin $path/user_key_bindings.fish >> $path/key_bindings_log
|
||||
|
|
|
@ -4,7 +4,7 @@ set -l fixtures $DIRNAME/fixtures/key-bindings/update
|
|||
function -S setup
|
||||
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 \
|
||||
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)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Add plugin bindingss to \$fisher_key_bindings"
|
||||
(cat $fisher_key_bindings | xargs) = "##norf## foo bar baz ##norf##"
|
||||
test "$TESTNAME - Add plugin bindingss to \$fisher_binds"
|
||||
(cat $fisher_binds | xargs) = "##norf## foo bar baz ##norf##"
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ set -l path $DIRNAME/.t-$TESTNAME-(random)
|
|||
function -S setup
|
||||
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
|
||||
|
||||
function -S teardown
|
||||
|
|
|
@ -8,14 +8,14 @@ function -S setup
|
|||
|
||||
__fisher_index_update
|
||||
|
||||
function wait
|
||||
eval $argv
|
||||
function spin -a commands
|
||||
eval "$commands"
|
||||
end
|
||||
end
|
||||
|
||||
function -S teardown
|
||||
rm -rf $path
|
||||
functions -e wait
|
||||
functions -e spin
|
||||
end
|
||||
|
||||
test "$TESTNAME - Get only names from index"
|
||||
|
|
|
@ -6,7 +6,7 @@ function -S setup
|
|||
source $DIRNAME/helpers/config-mock.fish $path/config
|
||||
|
||||
function __fisher_path_update
|
||||
echo "$argv"
|
||||
echo "$argv[1]"
|
||||
end
|
||||
|
||||
fisher install foo --quiet
|
||||
|
@ -21,9 +21,9 @@ function -S teardown
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
test "$TESTNAME - Update index and Fisherman's home"
|
||||
test "$TESTNAME - Update Index and \$fisher_home"
|
||||
(cat $path/self) = $fisher_home
|
||||
end
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue