Skip to content

Commit

Permalink
chore: simplify elan-init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Jun 24, 2024
1 parent c387805 commit f8c0c50
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions elan-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,13 @@ main() {
fi

ensure mkdir -p "$_dir"
local _latest=$(ensure curl -sSfL -o /dev/null -w %{url_effective} "$ELAN_UPDATE_ROOT/latest" | cut -d'"' -f2 | awk -F/ '{print $NF}')

case "$_arch" in
*windows*)
ensure curl -sSfL "$ELAN_UPDATE_ROOT/download/$_latest/elan-$_arch.zip" > "$_dir/elan-init.zip"
ensure curl -sSfL "$ELAN_UPDATE_ROOT/latest/download/elan-$_arch.zip" > "$_dir/elan-init.zip"
(cd "$_dir"; ensure unzip elan-init.zip; ignore rm elan-init.zip)
;;
*)
ensure curl -sSfL "$ELAN_UPDATE_ROOT/download/$_latest/elan-$_arch.tar.gz" > "$_dir/elan-init.tar.gz"
ensure curl -sSfL "$ELAN_UPDATE_ROOT/latest/download/elan-$_arch.tar.gz" > "$_dir/elan-init.tar.gz"
(cd "$_dir"; ensure tar xf elan-init.tar.gz; ignore rm elan-init.tar.gz)
;;
esac
Expand Down

0 comments on commit f8c0c50

Please sign in to comment.