Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install v2 using bundled release on Linux #4

Merged
merged 2 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

# Dependencies

- `bash`, `curl`, `tar`: generic POSIX utilities. These should be installed by default on most operating systems.
- `bash`, `curl`, `tar`, `unzip`: generic POSIX utilities. These should be installed by default on most operating systems.

- v1 - Linux/MacOS/Windows || v2 - Linux/Windows
- v1 - Linux/MacOS/Windows || v2 - Windows
- `Python 3.7.5+`: This plugin installs awscli from source into a virtualenv on these OS distributions. A currently maintained version of Python is required to do this.

# Install
Expand Down
2 changes: 1 addition & 1 deletion bin/list-bin-paths
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
MAJOR_VERSION="${ASDF_INSTALL_VERSION:0:1}"
OS_DISTRIBUTION="$(uname -s)"

if [[ "${OS_DISTRIBUTION}" == "Darwin" && "${MAJOR_VERSION}" == "2" ]]; then
if [[ ("${OS_DISTRIBUTION}" == "Darwin" || "${OS_DISTRIBUTION}" == "Linux") && "${MAJOR_VERSION}" == "2" ]]; then
echo "bin"
else
echo "venv/bin"
Expand Down
17 changes: 17 additions & 0 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ install_version() {
ln -s "${install_path}/aws-cli/aws_completer" "${install_path}/bin/aws_completer"
rm -rf "${release_file}" ./AWSCLIV2

test -x "${test_path}" || fail "Expected ${test_path} to be executable."
) || (
rm -rf "${install_path}"
fail "An error ocurred while installing awscli ${version}."
)
elif [[ "${os_distribution}" == "Linux" && "${major_version}" == "2" ]]; then
(
local release_file="${install_path}/awscli-${version}.zip"
local url="https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${version}.zip"

curl "${CURL_OPTS[@]}" -o "${release_file}" -C - "${url}" || fail "Could not download ${url}"

unzip -q ${release_file} -d ./AWSCLIV2 || fail "Could not extract ${release_file}"
mkdir "${install_path}/bin"
./AWSCLIV2/aws/install -i "${install_path}" -b "${install_path}/bin"
rm -rf "${release_file}" ./AWSCLIV2

test -x "${test_path}" || fail "Expected ${test_path} to be executable."
) || (
rm -rf "${install_path}"
Expand Down