-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The installer exits without waiting for the completion of git clone
#11
Comments
I tried it on another machine in the same way and it worked as expected here. % cat installer.zsh| zsh
✔ Checking if your zsh version is newer than 4.1.9 [SUCCEEDED]
✔ Installing zplug to /home/matsui/.zplug [SUCCEEDED]
All processes are successfully completed 🎉
For more information, see http://zplug.sh 🌺
Enjoy zplug!
2018年 11月 13日 火曜日 09:29:20 JST
✔ sleep 10 [SUCCEEDED]
2018年 11月 13日 火曜日 09:29:30 JST The environment is as follows. zsh 5.4.2 (x86_64-ubuntu-linux-gnu) |
In zsh-5.6.2 I found that connecting % sleep 30
^Z
zsh: suspended sleep 30
% echo $jobstates
suspended:+:16815=suspended
% echo $jobstates | cat
% echo $jobstates
suspended:+:16815=suspended I asked about this on the zsh-users mailing list and got the answer that this is the effect of bug fixes made in 5.6. In order to prevent the left side of the pipe operator executed by subshell from influencing the parent, parameter expansion is performed after forking, and it seems that As a result, it seems that the logic for judging completion of job in the echo "$jobstates" \
| awk '
/[0-9]+=/ {
jobs[++job_count] = $0
}
END {
for (i = 1; i <= job_count; i++) {
print(jobs[i])
}
exit job_count == 0
}' \
| xargs test -z && break I think that the part here can be written as follows without using pipes. [ $#jobstates = 0 ] && break |
The installer exits without waiting for the completion of
git clone
. This is not a problem when running the installer manually. However, if you write.zshrc
to automatically run the installer if zplug is not installed, subsequent processing using zplug will cause an error depending on the timing.It seems that
spin()
is responsible for waiting for the job to finish, but it does not seem to work well.If you add the following code to the end of the installer, the output will be as follows. It is expected to wait for 10 seconds sleeping, but in fact it finished almost immediately.
My environment is as follows.
zsh 5.6.2 (x86_64-apple-darwin18.0.0)
GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.1, GNU MP 6.1.2)
The text was updated successfully, but these errors were encountered: