Skip to content

Commit

Permalink
Fix format & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan Diamond committed Nov 24, 2023
1 parent ebbec2d commit f89e2be
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ mkdir -p "$ASDF_DOWNLOAD_PATH"
release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME"

#Download file to the download directory
download_release "$ASDF_INSTALL_VERSION" "$release_file"
download_release "$ASDF_INSTALL_VERSION" "$release_file"
66 changes: 33 additions & 33 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,46 @@ list_all_versions() {

download_release() {
local version filename url target
target="$(get_target)"
target="$(get_target)"
version="$1"
filename="$2"

#Ex: https://github.com/moonrepo/moon/releases/download/v1.17.3/moon-aarch64-apple-darwin
#Ex: https://github.com/moonrepo/moon/releases/download/v1.17.3/moon-aarch64-apple-darwin
url="$GH_REPO/releases/download/v${version}/${target}"

echo "* Downloading $TOOL_NAME release $version for target ${target}..."
curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"
}

get_target() {
arch=$(uname -sm)

if [[ "${OS-}" == "Windows_NT" ]]; then
target="moon-x86_64-pc-windows-msvc.exe"
else
case "$arch" in
"Darwin x86_64") target="moon-x86_64-apple-darwin" ;;
"Darwin arm64") target="moon-aarch64-apple-darwin" ;;
"Linux aarch64") target="moon-aarch64-unknown-linux" ;;
"Linux x86_64") target="moon-x86_64-unknown-linux" ;;
*)
echo "Unsupported system or architecture \"$arch\". Unable to install moon!"
exit 1
;;
esac
fi

if [[ "$arch" == "Linux"* ]]; then
deps=$(ldd --version 2>&1 || true)

if [[ $deps == *"musl"* ]]; then
target="$target-musl"
else
target="$target-gnu"
fi
fi

echo $target
arch=$(uname -sm)

if [[ "${OS-}" == "Windows_NT" ]]; then
target="moon-x86_64-pc-windows-msvc.exe"
else
case "$arch" in
"Darwin x86_64") target="moon-x86_64-apple-darwin" ;;
"Darwin arm64") target="moon-aarch64-apple-darwin" ;;
"Linux aarch64") target="moon-aarch64-unknown-linux" ;;
"Linux x86_64") target="moon-x86_64-unknown-linux" ;;
*)
echo "Unsupported system or architecture \"$arch\". Unable to install moon!"
exit 1
;;
esac
fi

if [[ "$arch" == "Linux"* ]]; then
deps=$(ldd --version 2>&1 || true)

if [[ $deps == *"musl"* ]]; then
target="$target-musl"
else
target="$target-gnu"
fi
fi

echo $target
}

install_version() {
Expand All @@ -82,14 +82,14 @@ install_version() {
local install_path="${3%/bin}/bin"

if [ "$install_type" != "version" ]; then
fail "asdf-$TOOL_NAME supports release installs only"
fail "asdf-$TOOL_NAME supports release installs only!"
fi

(
echo "* Installing $TOOL_NAME $version..."
echo "* Installing $TOOL_NAME $version..."
mkdir -p "$install_path"
cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path"
chmod 755 "$install_path/$TOOL_NAME"
chmod 755 "$install_path/$TOOL_NAME"

local tool_cmd
tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)"
Expand Down

0 comments on commit f89e2be

Please sign in to comment.