asdf-dart icon indicating copy to clipboard operation
asdf-dart copied to clipboard

Protect against attempting to download invalid versions

Open PatOConnor43 opened this issue 6 years ago • 2 comments

Problem

The install script should validate the requested version before trying to download. This can result in empty downloads.

Proposed Solution

Either abort the install process if the user requests a version that is not included in the list-all script or allow supporting truncated versions (2 vs. 2.3.2) that will install the newest version version that starts with that major.

Reported in #5

PatOConnor43 avatar Jun 20 '19 02:06 PatOConnor43

I think I'm running into this. The last line of asdf install dart <version> output says it's unzipping, but when I check the directory the version should have been installed to, it's empty

➜  asdf install dart 2.7.0
Platform 'darwin' supported!
Arch 'arm64' not supported!
Version: 2.7.0
Install Path: /Users/jerold/.asdf/installs/dart/2.7.0
Platform: macos
Architecture:
Downloading to temp directory asdf-dart.RWwe
Include Extras: 0
Major Dart Version: 2
Installing Dart SDK...
https://storage.googleapis.com/dart-archive/channels/stable/release/2.7.0/sdk/dartsdk-macos--release.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   235  100   235    0     0   1058      0 --:--:-- --:--:-- --:--:--  1058
Unzipping Dart SDK to /Users/jerold/.asdf/installs/dart/2.7.0...

doesn't matter which version I try to install, the result is the same. The Arch 'arm64' not supported! line doesn't sound good.

jerold avatar Apr 17 '21 20:04 jerold

I think this PR should solve your issue. I'm going to keep this issue open for now because it doesn't solve the invalid version case. The overall experience when you fail platform/architecture/unzip validation should be better though. https://github.com/PatOConnor43/asdf-dart/pull/16

PatOConnor43 avatar Apr 17 '21 21:04 PatOConnor43