Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert scripts/install-latest.sh to a shim that loads the real script #2066

Merged
merged 1 commit into from
Dec 14, 2016

Conversation

Daniel15
Copy link
Member

Summary
I moved the installation script to the site, as that's a better place for it. Our documentation has always used https://yarnpkg.com/install.sh as the URL to the script, so everything should keep working as-is. However, some users may have hard-coded a link to the file directly in this repo (eg. https://raw.githubusercontent.com/yarnpkg/yarn/master/scripts/install-latest.sh). To handle this case, I'm converting the script to a small shim script that downloads the real one.

Test plan
Test with no params, ensure "This script has moved to" message appears, and it correctly downloads and executes that script:

daniel@Daniel-PC:/mnt/c/src/yarn/scripts$ ./install-latest.sh
This script has moved to https://yarnpkg.com/install.sh, please update your URL!
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6074    0  6074    0     0   8911      0 --:--:-- --:--:-- --:--:--  8906
Installing Yarn!
> Downloading tarball...

[1/2]: https://yarnpkg.com/latest.tar.gz --> /tmp/yarn.PTyJ3Qlrs1.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    92  100    92    0     0    758      0 --:--:-- --:--:-- --:--:--   766
  0     0    0   595    0     0   1120      0 --:--:-- --:--:-- --:--:--  1120
100 3530k  100 3530k    0     0  1456k      0  0:00:02  0:00:02 --:--:-- 1998k

[2/2]: https://yarnpkg.com/latest.tar.gz.asc --> /tmp/yarn.PTyJ3Qlrs1.tar.gz.asc
100    96  100    96    0     0   1547      0 --:--:-- --:--:-- --:--:--  1547
  0     0    0   600    0     0   3303      0 --:--:-- --:--:-- --:--:--  3303
100   832  100   832    0     0   2840      0 --:--:-- --:--:-- --:--:--  270k
> Verifying integrity...
gpg: Signature made Mon 28 Nov 2016 03:43:55 PM STD using RSA key ID FD2497F5
gpg: Good signature from "Yarn Packaging <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
     Subkey fingerprint: 6A01 0C51 6600 6599 AA17  F081 46C2 130D FD24 97F5
> GPG signature looks good
> Extracting to ~/.yarn...

Test with --version param, ensure it's passed to the real script:

daniel@Daniel-PC:/mnt/c/src/yarn/scripts$ ./install-latest.sh --version 0.17.8
This script has moved to https://yarnpkg.com/install.sh, please update your URL!
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6074    0  6074    0     0  48782      0 --:--:-- --:--:-- --:--:-- 48592
Installing Yarn!
> Downloading tarball...

[1/2]: https://yarnpkg.com/downloads/0.17.8/yarn-v0.17.8.tar.gz --> /tmp/yarn.e5MluuXhYl.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    92  100    92    0     0     82      0  0:00:01  0:00:01 --:--:--    82
  0     0    0   595    0     0    374      0 --:--:--  0:00:01 --:--:--  2945
100 3525k  100 3525k    0     0   986k      0  0:00:03  0:00:03 --:--:-- 2881k

[2/2]: https://yarnpkg.com/downloads/0.17.8/yarn-v0.17.8.tar.gz.asc --> /tmp/yarn.e5MluuXhYl.tar.gz.asc
100    96  100    96    0     0    310      0 --:--:-- --:--:-- --:--:--   310
  0     0    0   600    0     0   1412      0 --:--:-- --:--:-- --:--:--  1412
100   832  100   832    0     0   1485      0 --:--:-- --:--:-- --:--:--  1485
> Verifying integrity...
gpg: Signature made Mon 21 Nov 2016 10:18:40 PM STD using RSA key ID FD2497F5
gpg: Good signature from "Yarn Packaging <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
     Subkey fingerprint: 6A01 0C51 6600 6599 AA17  F081 46C2 130D FD24 97F5
> GPG signature looks good
> Extracting to ~/.yarn...

Closes #2058

@bestander
Copy link
Member

@Daniel15, please rebase

@Daniel15 Daniel15 merged commit 6a317c2 into yarnpkg:master Dec 14, 2016
@Daniel15 Daniel15 deleted the installshim branch December 14, 2016 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants