mirror of
https://github.com/tmux-plugins/tpm.git
synced 2024-10-31 23:28:47 +00:00
Merge pull request #92 from Graham42/faster_updating
Update plugins in parallel
This commit is contained in:
commit
cfaf15b768
@ -27,7 +27,6 @@ pull_changes() {
|
|||||||
|
|
||||||
update() {
|
update() {
|
||||||
local plugin="$1"
|
local plugin="$1"
|
||||||
echo_ok "Updating \"$plugin\""
|
|
||||||
$(pull_changes "$plugin" > /dev/null 2>&1) &&
|
$(pull_changes "$plugin" > /dev/null 2>&1) &&
|
||||||
echo_ok " \"$plugin\" update success" ||
|
echo_ok " \"$plugin\" update success" ||
|
||||||
echo_err " \"$plugin\" update fail"
|
echo_err " \"$plugin\" update fail"
|
||||||
@ -41,9 +40,10 @@ update_all() {
|
|||||||
local plugin_name="$(plugin_name_helper "$plugin")"
|
local plugin_name="$(plugin_name_helper "$plugin")"
|
||||||
# updating only installed plugins
|
# updating only installed plugins
|
||||||
if plugin_already_installed "$plugin_name"; then
|
if plugin_already_installed "$plugin_name"; then
|
||||||
update "$plugin_name"
|
update "$plugin_name" &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
wait
|
||||||
}
|
}
|
||||||
|
|
||||||
update_plugins() {
|
update_plugins() {
|
||||||
@ -51,11 +51,12 @@ update_plugins() {
|
|||||||
for plugin in $plugins; do
|
for plugin in $plugins; do
|
||||||
local plugin_name="$(plugin_name_helper "$plugin")"
|
local plugin_name="$(plugin_name_helper "$plugin")"
|
||||||
if plugin_already_installed "$plugin_name"; then
|
if plugin_already_installed "$plugin_name"; then
|
||||||
update "$plugin_name"
|
update "$plugin_name" &
|
||||||
else
|
else
|
||||||
echo_err "$plugin_name not installed!"
|
echo_err "$plugin_name not installed!" &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
wait
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user