File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,23 @@ if [[ "$VERSION" = "latest" ]]; then {
1010 unset VERSION
1111} fi
1212
13+ apt_get_update ()
14+ {
15+ if [ " $( find /var/lib/apt/lists/* | wc -l) " = " 0" ]; then
16+ echo " Running apt-get update..."
17+ apt-get update -y
18+ fi
19+ }
20+
21+ # Checks if packages are installed and installs them if not
22+ check_packages () {
23+ if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
24+ apt_get_update
25+ apt-get -y install --no-install-recommends " $@ "
26+ fi
27+ }
28+
29+ export DEBIAN_FRONTEND=noninteractive
30+ check_packages curl
31+
1332curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash
Original file line number Diff line number Diff line change @@ -23,6 +23,25 @@ if [[ -z "$VERSION" ]] || [[ "$VERSION" = "latest" ]]; then {
2323 VERSION=$( curl -sLI -o /dev/null -w ' %{url_effective}' " $LATEST_URL " | cut -d " v" -f 2)
2424} fi
2525
26+ apt_get_update ()
27+ {
28+ if [ " $( find /var/lib/apt/lists/* | wc -l) " = " 0" ]; then
29+ echo " Running apt-get update..."
30+ apt-get update -y
31+ fi
32+ }
33+
34+ # Checks if packages are installed and installs them if not
35+ check_packages () {
36+ if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
37+ apt_get_update
38+ apt-get -y install --no-install-recommends " $@ "
39+ fi
40+ }
41+
42+ export DEBIAN_FRONTEND=noninteractive
43+ check_packages curl
44+
2645echo " Installing exercism-cli: v${VERSION} "
2746
2847RELEASE_URL=" ${GITHUB_BASE_URL} /releases/download/v${VERSION} /exercism-${VERSION} -${OS} -${ARCH} .tar.gz"
You can’t perform that action at this time.
0 commit comments