Display deps as they install along with parent plugin.

This commit is contained in:
Jorge Bucaran 2016-02-04 13:52:43 +09:00
parent bee326dc3d
commit 85bbcccd27
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30
2 changed files with 9 additions and 23 deletions

View file

@ -1,13 +1,7 @@
function __fisher_deps_install -a path
printf 0
if test -s $path/bundle -o -s $path/fishfile
printf "Installing dependencies >> (%s)\n" (
for file in $path/{bundle,fishfile}
__fisher_list $file
end | paste -sd ' ' -
) > /dev/stderr
cat $path/{bundle,fishfile} | fisher_install ^| sed -En 's/([0-9]+) plugin\/s.*/\1/p'
end
for file in $path/{fishfile,bundle}
if test -s $file
fisher_install < $file | sed -En 's/^.+([0-9]+) plugin\/s.*/\1/p'
end
end | awk '{ n = n + $0 } END { print n ? n : 0 }'
end

View file

@ -8,16 +8,12 @@ function -S setup
function fisher_install
set -l count 0
while read -l plugin
# Fisherman CLI text message are usually written to /dev/stderr,
# so we must write to /dev/stderr too.
echo $plugin > /dev/stderr
set count (math $count + 1)
end
echo "$count plugin/s" > /dev/stderr
echo "Aye! $count plugin/s installed."
end
end
@ -26,14 +22,10 @@ function -S teardown
functions -e fisher_install
end
test "$TESTNAME - List dependencies to be installed"
(__fisher_deps_install $path > /dev/null ^| sed -E 's/.*>> (.*)/\1/') = "(foo bar baz norf)"
end
test "$TESTNAME - Install dependencies from one or more bundle/fishfile files"
(__fisher_deps_install $path ^ /dev/null) = 04
(__fisher_deps_install $path ^ /dev/null) = 4
end
test "$TESTNAME - Fail to indicate no dependencies were installed"
test "$TESTNAME - Print 0 to indicate no dependencies were installed"
(__fisher_deps_install $path/void) = 0
end