Open mgolebiowski opened 2 years ago
The install file is here: https://github.com/yarnpkg/website/blob/master/install.sh
The easiest way would be to resolve the version using npm
, something like
npm view yarn@$1 version | tail -n1 | grep -o "'.*'" | cut -d "'" -f2
Here you can check how the npm solution could look like: https://github.com/mgolebiowski/website/commit/b8d64d57bc35dbea757af659293cc594691dacea
If we don't want to use npm, we could follow yarn set version
that is using GitHub API[0], this would require parsing the JSON output as well as finding the correct tag to generate the URL.
Having to specify the
PATCH
part of the version shouldn't be necessary, Bothyarn set version
andnpm install -g yarn@1
properly resolve to the newest version based on the part user specified (1.22 -> 1.22.17 etc.) and having the same feature in the install script would be really nice.curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22
Should install
1.22.$latest