From a779475ee2ef4c6bb49c43abdca4d0e03d141b83 Mon Sep 17 00:00:00 2001 From: John Martel Date: Tue, 16 Jan 2024 21:07:21 -0500 Subject: [PATCH] fix: install shorebird's internal flutter version before install --- lib/utils.bash | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/utils.bash b/lib/utils.bash index 15a44ac..219c7ea 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -55,11 +55,19 @@ install_version() { ( mkdir -p "$install_path" - cp -r "$ASDF_DOWNLOAD_PATH"/.git "$install_path" - cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path" local tool_cmd tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)" + + # shorebird downloads and caches its internal flutter version on first use + "$ASDF_DOWNLOAD_PATH/bin/$tool_cmd" + + cp -r "$ASDF_DOWNLOAD_PATH"/.git "$install_path" + cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path" + + # avoid file permission override when asdf core deletes the download folder + rm -rf "$ASDF_DOWNLOAD_PATH"/.git + test -x "$install_path/bin/$tool_cmd" || fail "Expected $install_path/bin/$tool_cmd to be executable." echo "$TOOL_NAME $version installation was successful!"