Skip to content

Commit caab05b

Browse files
committed
Install curl on Linux if not already there
1 parent 1f65c5d commit caab05b

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

linux-installer/idt-installer

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ function install_deps {
189189
fi
190190
[[ -z "$(which brew)" ]] && USEBREW=false
191191

192+
# Install curl if not already installed.
193+
if ! $(which curl >/dev/null 2&>1); then
194+
if [ "$PLATFORM" = Linux ]; then
195+
$SUDO apt-get -y update
196+
$SUDO apt-get -y install curl
197+
fi
198+
fi
199+
192200
for item in "${EXT_PROGS[@]}"; do
193201
#-- Parse array item into vars
194202
IFS="," read -r prog_bin prog_brew prog_url <<< "$item"
@@ -200,9 +208,13 @@ function install_deps {
200208
log "You should review any setup requirements for '${prog_bin}' from: ${prog_url}"
201209
elif [[ "$prog_bin" == "git" ]]; then
202210
if [[ -n "$(which "apt-get")" ]]; then
203-
# Make sure add-apt-repository is installed.
204-
$SUDO apt-get install -y software-properties-common python-software-properties
205211
# Get up-to-date git.
212+
$SUDO apt-get -y update
213+
214+
# Make sure add-apt-repository is installed.
215+
if ! $(which add-apt-repository >/dev/null 2&>1); then
216+
$SUDO apt-get install -y software-properties-common python-software-properties
217+
fi
206218
$SUDO add-apt-repository -y ppa:git-core/ppa
207219
$SUDO apt-get -y update
208220
$SUDO apt-get -y install git
@@ -403,7 +415,11 @@ function main {
403415
"Darwin")
404416
;;
405417
"Linux")
406-
warn "Linux has only been tested on Ubuntu, please let us know if you use this utility on other Distros"
418+
# Linux distro, e.g "Ubuntu", "RedHatEnterpriseWorkstation", "RedHatEnterpriseServer", "CentOS", "Debian"
419+
DISTRO=$(lsb_release -is 2>/dev/null || echo "")
420+
if [ "$DISTRO" != Ubuntu ]; then
421+
warn "Linux has only been tested on Ubuntu, please let us know if you use this utility on other Distros"
422+
fi
407423
;;
408424
*)
409425
warn_unsupported

0 commit comments

Comments
 (0)