diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd3fb29..08a8aa5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## [1.5.0][v150] - 2016-04-18
+
+* So long `make`, the fisherman installer is now entirely written in fish #196, #184.
+
## [1.4.0][v140] - 2016-03-31
* :warning: Deprecate --force flag in fisher install.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 106edc2..0000000
--- a/Makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-SHELL:=/usr/bin/env bash -O nullglob
-
-XDG_CONFIG_HOME ?= $$HOME/.config
-FISH_CONFIG := $(XDG_CONFIG_HOME)/fish/config.fish
-
-FISHER_HOME := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
-FISHER_CONFIG := $(XDG_CONFIG_HOME)/fisherman
-FISHER_CACHE := $(FISHER_CONFIG)/cache
-FISHER_FILE := $(FISHER_CONFIG)/fishfile
-
-MAN := $(FISHER_HOME)/man
-MAN1 := $(wildcard $(MAN)/man1/*.md)
-DOCS := $(MAN1:%.md=%.1)
-
-INDEX := $(FISHER_CACHE)/.index
-VERSION = `cat $(FISHER_HOME)/VERSION`
-
-.PHONY: all test flush uninstall release
-
-all: $(FISH_CONFIG) $(FISHER_CACHE) $(FISHER_FILE) $(DOCS)
- @echo "** Reload your shell and type 'fisher' to get started **"
-
-test:
- fish -c "fishtape test/*.fish"
-
-uninstall:
- 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,"Reload your shell to apply changes.")
-
-release: $(FISHER_HOME)
- 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;\
- git -C $^ add README.md;\
- git -C $^ add $^/VERSION;\
- git -C $^ commit --quiet -m $(VERSION);\
- git -C $^ tag $(VERSION) -m v$(VERSION) --force > /dev/null;\
- else\
- echo "Commit changes and update VERSION to tag a new release.";\
- fi
-
-$(FISH_CONFIG):
- 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
- cat "$@.tmp" > $@ && rm $@.fisher
-
-$(FISHER_CACHE):
- mkdir -p $@
-
-$(FISHER_FILE):
- touch $@
-
-%.1 : %.md
- -@if type ronn 2>/dev/null 1>&2; then \
- ronn --manual=fisherman --roff $? 1>&2 2> /dev/null;\
- fi;\
diff --git a/README.md b/README.md
index 986c072..14c7cdf 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
@@ -18,7 +18,7 @@
[![Build Status][travis-badge]][travis-link]
-[![Fisherman Version][version-badge]][version-link]
+[![fisherman Version][version-badge]][version-link]
[![Slack Room][slack-badge]][slack-link]
## Install
@@ -146,7 +146,7 @@ The legend consists of:
## Plumbing
-Fisherman commands are pipe aware. Plumb one with another to create complex functionality.
+fisherman commands are pipe aware. Plumb one with another to create complex functionality.
Update plugins installed as symbolic links.
@@ -166,21 +166,21 @@ Uninstall all the plugins and remove them from the cache.
fisher list | fisher uninstall --force
```
-## Dotfiles
+## Bundle
-When you install a plugin, Fisherman updates the *fishfile* to track what plugins are currently enabled.
+When you install a plugin, fisherman updates the *bundle* file to track what plugins are currently active.
-* Customize the location of the fishfile.
+* Customize the location of the bundle.
```fish
-set -g fisher_file ~/.dotfiles/fishfile
+set -g fisher_file ~/.dotfiles/bundle
```
-## Flat Tree
+## Flat tree
-Fisherman merges the directory trees of all the plugins it installs into a single flat tree. Since the flat tree is loaded only once at the start of the shell, Fisherman performs equally well, regardless of the number of plugins installed.
+fisherman merges the directory trees of all the plugins it installs into a single flat tree. Since the flat tree is loaded only once at the start of the shell, fisherman performs equally well, regardless of the number of plugins installed.
-The following illustrates an example Fisherman configuration path with a single plugin and prompt.
+The following illustrates an example fisherman configuration path with a single plugin and prompt.
```
$fisher_config
@@ -189,7 +189,7 @@ $fisher_config
│ └── my_plugin.fish
├── conf.d
│ └── my_plugin.fish
-├── fishfile
+├── bundle
├── functions
│ ├── fish_prompt.fish
│ ├── fish_right_prompt.fish
@@ -201,7 +201,7 @@ $fisher_config
## Index
-The index is a plain text database that lists Fisherman official plugins.
+The index is a plain text database that lists fisherman official plugins.
The index lists records, each consisting the fields: *name*, *url*, *info*, one or more *tags* and *author*.
@@ -225,19 +225,19 @@ git push origin master
## Variables
* $fisher_home:
- The home directory. If you installed Fisherman using the recommended method, the location ought to be *XDG_DATA_HOME/fisherman*.
+ The home directory. If you installed fisherman using the recommended method, the location ought to be *XDG_DATA_HOME/fisherman*.
* $fisher_config:
- The configuration directory. This is default location of your *fishfile*, *key_bindings.fish*, *cache*, *functions*, *completions* and *conf.d* directories. *XDG_CONFIG_HOME/fisherman* by default.
+ The configuration directory. This is default location of your *bundle*, *key_bindings.fish*, *cache*, *functions*, *completions* and *conf.d* directories. *XDG_CONFIG_HOME/fisherman* by default.
* $fisher_file:
- See [fishfile](#dotfiles) above.
+ The location of the bundle file.
* $fisher_cache:
The cache directory. Plugins are downloaded to this location.
* $fisher_alias *command*=*alias* ...:
- Use this variable to create aliases of Fisherman commands.
+ Use this variable to create aliases of fisherman commands.
[travis-link]: https://travis-ci.org/fisherman/fisherman
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
@@ -251,10 +251,8 @@ git push origin master
[play]: https://cloud.githubusercontent.com/assets/8317250/14401577/14411b12-fe51-11e5-8d5a-bb054edfc2d4.png
[play-link]: http://fisherman.sh/#demo
-[Get Started]: https://github.com/fisherman/fisherman/wiki
[Plugins]: http://fisherman.sh/#search
[fish]: https://github.com/fish-shell/fish-shell
-[other]: https://github.com/fisherman/fisherman/wiki/Installing-Fisherman#notes
-[Fisherman]: http://fisherman.sh
-[new]: https://github.com/fishery/new
+[other]: https://github.com/fisherman/fisherman/wiki/Installing-fisherman#notes
+[fisherman]: http://fisherman.sh
diff --git a/bin/install b/bin/install
new file mode 100755
index 0000000..f7b6fe6
--- /dev/null
+++ b/bin/install
@@ -0,0 +1,177 @@
+#!/usr/bin/env fish
+
+function __fisher_format_source_safe
+ if not command fish_indent $argv ^ /dev/null
+ command fish_indent
+ end
+end
+
+function __fisher_home_humanize
+ set -l tilde "$fisher_color_param~$fisher_color_close"
+ sed "s|$HOME|$tilde|"
+end
+
+function __fisher_run_commands -a message commands
+ set -l fish_debug_copy $fish_debug
+ set fish_debug
+
+ set -l tmp (mktemp -t fisherman.XXX)
+
+ fish -c "$commands" > /dev/null ^ $tmp &
+
+ while true
+ for spinner in ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏
+ set -l message (printf "%s\n" $message | __fisher_home_humanize)
+ printf " $fisher_color_param$spinner$fisher_color_close $message\r"
+ sleep 0.05
+ end
+
+ set -l last_job (jobs -l | command awk -v FS=\t '
+ /[0-9]+\t/{
+ jobs[++job_count] = $1
+ }
+
+ END {
+ for (i = 1; i <= job_count; i++) {
+ print(jobs[i])
+ }
+
+ exit job_count == 0
+ }
+ ')
+
+ if test -z "$last_job"
+ break
+ end
+ end
+
+ if test -s $tmp
+ cat $tmp
+
+ printf "\r $fisher_error_symbol\n\n"
+
+ printf "Sorry, but I couldn't install fisherman. Some things you can try:\n\n"
+
+ printf "%s\n" " $fisher_arrow_symbol Upgrade your Git version (^2.0)"
+ printf "%s\n" " $fisher_arrow_symbol Upgrade your Fish version (^2.2.0)"
+ printf "%s\n" " $fisher_arrow_symbol Make sure you can write to $fisher_home"
+ printf "%s\n"
+ printf "%s\n" "For more help visit "$fisher_color_uline"http://issues.fisherman.sh$fisher_color_close"
+
+ command rm -f $tmp
+
+ set fish_debug $fish_debug_copy
+
+ exit 1
+ end
+
+ set fish_debug $fish_debug_copy
+
+ command rm -f $tmp
+
+ printf "\r $fisher_check_symbol \n"
+end
+
+function __fisher_install_fisherman
+ set xdg_home ~/.local/share
+ set xdg_config ~/.config
+
+ if test ! -z "$XDG_DATA_HOME"
+ set xdg_home "$XDG_DATA_HOME"
+ end
+
+ if test ! -z "$XDG_CONFIG_HOME"
+ set xdg_config "$XDG_CONFIG_HOME"
+ end
+
+ set fisher_home "$xdg_home/fisherman"
+ set fisher_config "$xdg_config/fisherman"
+ set fish_config "$xdg_config/fish"
+
+ if test ! -z "$FISHER_HOME"
+ set fisher_home "$FISHER_HOME"
+ end
+
+ if test ! -z "$FISHER_CONFIG"
+ set fisher_config "$FISHER_CONFIG"
+ end
+
+ set -l config "$fish_config/config.fish"
+
+ if test -d $fisher_home
+ printf " $fisher_error_symbol %s\n\n" "fisherman is already installed. To reinstall:"
+
+ printf " $fisher_arrow_symbol %s\n" "Remove $fisher_home" \
+ | __fisher_home_humanize
+
+ if test -s $config
+ printf " $fisher_arrow_symbol %s\n" "Remove this configuration from $fish_config" \
+ | __fisher_home_humanize
+
+ printf "%s\n"
+ set -l indent " "
+ grep "fisher" $config | __fisher_format_source_safe --ansi | sed "s/^/ $indent /"
+
+ set_color normal
+ end
+
+ printf "\n%s\n" "For more help visit "$fisher_color_uline"http://issues.fisherman.sh$fisher_color_close"
+
+ exit 1
+ end
+
+ if test "$version" = 2.1.2
+ printf "%s\n" (set_color ff0
+ )" • Please upgrade to fish 2.2.0 for best results.$fisher_color_close"
+ end
+
+ __fisher_run_commands \
+ "Downloading fisherman to $fisher_home" \
+ "git clone --quiet --depth 1 $fisher_remote_uri $fisher_home"
+
+
+ set -l home ~
+
+ __fisher_run_commands \
+ "Installing fisherman to $fisher_config" \
+ "
+ mkdir -p $fisher_config/{cache,functions,completions,conf.d,man}
+ pushd $fish_config
+
+ echo 'set -g fisher_home $fisher_home' | sed 's|/\$||;s|$home|~|' >> fisherconf
+ echo 'set -g fisher_config $fisher_config' | sed 's|$home|~|' >> fisherconf
+ echo 'source \$fisher_home/config.fish' >> fisherconf
+
+ command awk 'FNR==NR{ print; a[\$0]; next } !(\$0 in a) || /^\$/' config.fish fisherconf > config.fish.tmp
+ command mv config.fish.tmp config.fish
+ command rm fisherconf
+
+ __fisher_index_update 0
+ "
+
+ set -l gray (set_color aaa)
+
+ printf " $fisher_check_symbol ""$gray"" Done! Enter $fisherman""``fisher``""$fisher_color_close ""$gray""to get started\n\n"
+
+ printf " $fisher_arrow_symbol Plugins "$fisher_color_uline"http://plugins.fisherman.sh$fisher_color_close\n"
+ printf " $fisher_arrow_symbol Community "$fisher_color_uline"http://slack.fisherman.sh$fisher_color_close\n"
+
+ if set -q CI
+ exit
+ end
+
+ exec fish < /dev/tty
+end
+
+set -g fisher_color_param (set_color $fish_color_param)
+set -g fisher_color_uline (set_color -u)
+set -g fisher_color_error (set_color $fish_color_error)
+set -g fisher_color_close (set_color $fish_color_normal)
+
+set -g fisher_check_symbol $fisher_color_param"✔"$fisher_color_close
+set -g fisher_error_symbol $fisher_color_error"✘"$fisher_color_close
+set -g fisher_arrow_symbol $fisher_color_param"▸"$fisher_color_close
+
+set -g fisher_remote_uri "https://github.com/fisherman/fisherman"
+
+__fisher_install_fisherman
diff --git a/functions/fisher.fish b/functions/fisher.fish
index cc0edc0..a07fc71 100644
--- a/functions/fisher.fish
+++ b/functions/fisher.fish
@@ -59,11 +59,11 @@ function fisher -d "fish plugin manager"
set -l color (set_color -u)
set -l color_normal (set_color normal)
- printf "Commands:\n"
+ printf "where can be one of:\n"
__fisher_help_commands | sed "
- s/^/ /
- s/;/"\t" /
+ s/^/ /
+ s/;/"\t" /
" | column -ts\t
end
end
diff --git a/functions/spin.fish b/functions/spin.fish
index 350c674..680ec38 100644
--- a/functions/spin.fish
+++ b/functions/spin.fish
@@ -58,7 +58,7 @@ function spin -d "Background job spinner"
}
' > /dev/stderr
- sleep 0.01
+ sleep 0.05
end
end
end