Skip to content

Commit

Permalink
fixes asdf-community#33: install from zip files
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatcuk committed Aug 30, 2022
1 parent d108efd commit 5627b53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ install() {
mkdir -p "${ASDF_INSTALL_PATH}"
cd "${ASDF_INSTALL_PATH}" || exit 1
curl -OJL "${url}"
tar xf "${fileName}" --strip 1
if [ "${fileName##*.}" == "zip" ]; then
local tmpdir="$(mktemp -d)"
unzip -d "${tmpdir}" "${fileName}"
mv "${tmpdir}/flutter"/* "${ASDF_INSTALL_PATH}/"
else
tar xf "${fileName}" --strip 1
fi
rm -f "${fileName}"
}

Expand Down

0 comments on commit 5627b53

Please sign in to comment.