File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ function installed_or_install
4+ {
5+ # installed_or_install executable [package]
6+ # Provide package name if it differs from executable name
7+ if [ -z " $1 " ]
8+ then
9+ echo " [bootstrap] Error! No package name provided to check for installation."
10+ exit 1
11+ fi
12+ local executable package
13+ executable=" $1 "
14+ package=" $1 "
15+ [ -n " $2 " ] && package=" $2 "
16+ hash " ${executable} " 2> /dev/null || sudo apt-get install --assume-yes -qq " ${package} "
17+ }
18+
19+ # Make sure curl is installed
20+ installed_or_install curl
321# Make sure git is installed
4- hash git 2> /dev/null || sudo apt-get install --assume-yes -qq git
22+ installed_or_install git
523# Make sure lsb-release is installed
6- hash lsb_release 2> /dev/null || sudo apt-get install --assume-yes -qq lsb-release
24+ installed_or_install lsb_release lsb-release
25+ # Make sure python3 is installed
26+ installed_or_install python3
727# Make sure python3-virtualenv is installed
8- hash virtualenv 2> /dev/null || sudo apt-get install --assume-yes -qq python3-virtualenv
28+ installed_or_install virtualenv python3-virtualenv
929
1030# Check if OS is Ubuntu
1131DISTRIB_ID=" $( lsb_release -si) "
You can’t perform that action at this time.
0 commit comments