Skip to content

Commit

Permalink
get-stack: check deps before sudo
Browse files Browse the repository at this point in the history
Don't need to invoke sudo if all deps are already installed.
Avoiding the sudo prompt where possible is going to be an improvement.
  • Loading branch information
bukzor authored Jun 10, 2018
1 parent df6520a commit 4a8d4de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion etc/scripts/get-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@ try_install_pkgs() {

# Install packages using apt-get
apt_get_install_pkgs() {
if ! sudocmd apt-get install -y ${QUIET:+-qq} "$@"; then
if dpkg-query -W "$@" > /dev/null; then
info "Already installed!"
elif ! sudocmd apt-get install -y ${QUIET:+-qq} "$@"; then
die "Installing apt packages failed. Please run 'apt-get update' and try again."
fi
}
Expand Down

0 comments on commit 4a8d4de

Please sign in to comment.