mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-09 07:10:27 +00:00
Display deps as they install along with parent plugin.
This commit is contained in:
parent
b575a06ee0
commit
0758a42cb6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user