Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
  • Loading branch information
pepov committed May 20, 2023
1 parent bdf25c3 commit 28cc3a6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
current_script_path=${BASH_SOURCE[0]}
plugin_dir=$(dirname "$(dirname "$current_script_path")")

# shellcheck source=../lib/utils.bash
# shellcheck source=lib/utils.bash
source "${plugin_dir}/lib/utils.bash"

mkdir -p "$ASDF_DOWNLOAD_PATH"
Expand Down
2 changes: 1 addition & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
current_script_path=${BASH_SOURCE[0]}
plugin_dir=$(dirname "$(dirname "$current_script_path")")

# shellcheck source=../lib/utils.bash
# shellcheck source=lib/utils.bash
source "${plugin_dir}/lib/utils.bash"

install_version "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH"
2 changes: 1 addition & 1 deletion bin/latest-stable
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
current_script_path=${BASH_SOURCE[0]}
plugin_dir=$(dirname "$(dirname "$current_script_path")")

# shellcheck source=../lib/utils.bash
# shellcheck source=lib/utils.bash
. "${plugin_dir}/lib/utils.bash"

curl_opts=(-sI)
Expand Down
2 changes: 1 addition & 1 deletion bin/list-all
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
current_script_path=${BASH_SOURCE[0]}
plugin_dir=$(dirname "$(dirname "$current_script_path")")

# shellcheck source=../lib/utils.bash
# shellcheck source=lib/utils.bash
source "${plugin_dir}/lib/utils.bash"

list_all_versions | sort_versions | xargs echo
46 changes: 23 additions & 23 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,34 @@ list_all_versions() {
}

get_machine_os() {
local OS
OS=$(uname -s | tr '[:upper:]' '[:lower:]')

case "${OS}" in
darwin*) echo "darwin" ;;
linux*) echo "linux" ;;
*) fail "OS not supported: ${OS}" ;;
esac
local OS
OS=$(uname -s | tr '[:upper:]' '[:lower:]')

case "${OS}" in
darwin*) echo "darwin" ;;
linux*) echo "linux" ;;
*) fail "OS not supported: ${OS}" ;;
esac
}

get_machine_arch() {
local ARCH
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')

case "${ARCH}" in
i?86) echo "386" ;;
x86_64) echo "amd64" ;;
aarch64) echo "arm64" ;;
armv8l) echo "arm64" ;;
arm64) echo "arm64" ;;
*) fail "Architecture not supported: $ARCH" ;;
esac
local ARCH
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')

case "${ARCH}" in
i?86) echo "386" ;;
x86_64) echo "amd64" ;;
aarch64) echo "arm64" ;;
armv8l) echo "arm64" ;;
arm64) echo "arm64" ;;
*) fail "Architecture not supported: $ARCH" ;;
esac
}

download_release() {
local version filename url
version="$1"
name="$2"
local version url
name="$1"
version="$2"
os=$(get_machine_os)
arch=$(get_machine_arch)
release_file="$ASDF_DOWNLOAD_PATH/${name}_${version}.tar.gz"
Expand All @@ -78,7 +78,7 @@ download_release() {
tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $release_file"

# Remove the tar.gz file since we don't need to keep it
rm "$release_file"
rm "$release_file"
}

install_version() {
Expand Down

0 comments on commit 28cc3a6

Please # to comment.