Skip to content

Commit

Permalink
Merge pull request #4 from iamhsa/linux-v2-bundled-release
Browse files Browse the repository at this point in the history
* Install v2 using bundled release on Linux
* shmt fix
  • Loading branch information
MetricMike authored May 11, 2021
2 parents b9ba4c7 + 743ff88 commit 2c4638b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
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

0 comments on commit 2c4638b

Please sign in to comment.