Skip to content

Commit abf07d3

Browse files
committed
not install aws but use instead if already installed
1 parent 6b4107d commit abf07d3

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

scripts/evergreen/setup_aws.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ install_aws_cli_pip() {
4848
return 1
4949
fi
5050

51-
# Use pip3 if available, otherwise pip
52-
local pip_cmd="pip3"
53-
if ! command -v pip3 &> /dev/null; then
54-
pip_cmd="pip"
51+
# Check if AWS CLI exists and works before installing
52+
if command -v aws &> /dev/null && aws --version &> /dev/null 2>&1; then
53+
echo "AWS CLI is already installed and working:"
54+
aws --version
55+
return 0
5556
fi
5657

57-
echo "Installing AWS CLI using ${pip_cmd}..."
58-
${pip_cmd} install --user awscli
58+
echo "Installing AWS CLI using pip3..."
59+
pip3 install --user awscli
5960

6061
# Add ~/.local/bin to PATH if not already there (where pip --user installs)
6162
if [[ ":${PATH}:" != *":${HOME}/.local/bin:"* ]]; then
@@ -64,11 +65,11 @@ install_aws_cli_pip() {
6465
fi
6566

6667
# Verify installation
67-
if command -v aws &> /dev/null; then
68+
if command -v aws &> /dev/null && aws --version &> /dev/null 2>&1; then
6869
echo "AWS CLI v1 installed successfully:"
6970
aws --version
7071
else
71-
echo "Error: AWS CLI v1 installation failed or not found in PATH" >&2
72+
echo "Error: AWS CLI v1 installation failed" >&2
7273
return 1
7374
fi
7475
}

0 commit comments

Comments
 (0)