#!/usr/bin/env bash
# Copyright 2012 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

# Exit immediately if a command exits with a non-zero status.
set -o errexit
# Treat unset variables as an error when substituting.
set -o nounset

# Ensure that GNU make is installed.
if ! sudo -AE apt-get install --assume-yes make
then
    # The installation of `make` may have failed because the package
    # lists are out of date, so update them and try again.
    sudo -AE apt-get update
    sudo -AE apt-get install --assume-yes make
fi

exec "$@"
