Skip to content

Commit

Permalink
fix: version install script (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Williams <[email protected]>
  • Loading branch information
pjwilliams2 and Patrick Williams authored Aug 16, 2023
1 parent 1635a49 commit 66eb6b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ fi
# check if CircleCI CLI needs to be installed

if command -v circleci > "$OUTPUT" 2>&1; then
if circleci version | grep "${CIRCLECI_CLI_VERSION:1}" > /dev/null 2>&1; then
VERSION="${CIRCLECI_CLI_VERSION:1}"
if circleci version | grep "${VERSION}" > /dev/null 2>&1; then
echo "circleci $CIRCLECI_CLI_VERSION is already installed"
exit 0
else
echo "A different version of the CircleCI CLI is installed ($(circleci version)); updating it"
$SUDO rm -f "$(which circleci)"
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | $SUDO bash
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | $SUDO VERSION="$VERSION" bash
echo "CircleCI CLI version $(circleci --skip-update-check version) has been installed to $(which circleci)"
fi
fi

0 comments on commit 66eb6b0

Please sign in to comment.