mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
fix: don't hang if there are jobs in the bg; close #523
This commit is contained in:
parent
ae878a8e9c
commit
c7472b2961
1 changed files with 6 additions and 4 deletions
10
fisher.fish
10
fisher.fish
|
@ -258,6 +258,7 @@ function _fisher_parse -a mode cmd
|
||||||
end
|
end
|
||||||
|
|
||||||
function _fisher_fetch
|
function _fisher_fetch
|
||||||
|
set -l pkg_jobs
|
||||||
set -l out_pkgs
|
set -l out_pkgs
|
||||||
set -l next_pkgs
|
set -l next_pkgs
|
||||||
set -l local_pkgs
|
set -l local_pkgs
|
||||||
|
@ -293,7 +294,6 @@ function _fisher_fetch
|
||||||
' | read -l url pkg branch
|
' | read -l url pkg branch
|
||||||
|
|
||||||
if test ! -d "$fisher_config/$pkg"
|
if test ! -d "$fisher_config/$pkg"
|
||||||
set next_pkgs $next_pkgs "$fisher_config/$pkg"
|
|
||||||
fish -c "
|
fish -c "
|
||||||
echo fetching $url >&2
|
echo fetching $url >&2
|
||||||
command mkdir -p $fisher_config/$pkg $fisher_cache/(command dirname $pkg)
|
command mkdir -p $fisher_config/$pkg $fisher_cache/(command dirname $pkg)
|
||||||
|
@ -313,11 +313,13 @@ function _fisher_fetch
|
||||||
echo fisher: cannot add \"$pkg\" -- is this a valid package\? >&2
|
echo fisher: cannot add \"$pkg\" -- is this a valid package\? >&2
|
||||||
end
|
end
|
||||||
" >/dev/null &
|
" >/dev/null &
|
||||||
|
set pkg_jobs $pkg_jobs (_fisher_jobs --last)
|
||||||
|
set next_pkgs $next_pkgs "$fisher_config/$pkg"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if set -l jobs (_fisher_jobs)
|
if set -q pkg_jobs[1]
|
||||||
while for job in $jobs
|
while for job in $pkg_jobs
|
||||||
contains -- $job (_fisher_jobs); and break
|
contains -- $job (_fisher_jobs); and break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -415,7 +417,7 @@ function _fisher_rm -a pkg
|
||||||
end
|
end
|
||||||
|
|
||||||
function _fisher_jobs
|
function _fisher_jobs
|
||||||
jobs $argv | command awk '/^[0-9]+\t/ { print (status = $1) } END { exit !status }'
|
jobs $argv | command awk '/^[0-9]+\t/ { print $1 }'
|
||||||
end
|
end
|
||||||
|
|
||||||
function _fisher_now -a elapsed
|
function _fisher_now -a elapsed
|
||||||
|
|
Loading…
Reference in a new issue