-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add --version
flag to install script
#1928
Conversation
I'm open to renaming the install script (since it no longer installs the latest), but didn't want to make such a sweeping change yet. |
@@ -107,16 +109,24 @@ yarn_install() { | |||
|
|||
if [ -d "$HOME/.yarn" ]; then | |||
if [ -n `which yarn` ]; then | |||
local SPECIFIED_VERSION | |||
local VERSION_TYPE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use local
for these but latest_url
doesn't use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally forgot about it, good catch!
if [ "$1" = '--nightly' ]; then | ||
latest_url=https://nightly.yarnpkg.com/latest-tar-version | ||
SPECIFIED_VERSION=`curl $latest_url` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use lowercase for variables (I know, I messed this up in some files, I need to fix it 😛 ). Apparently uppercase is generally only used for environment variables.
This is awesome! Thank you! |
Document how to use the changes per yarnpkg/yarn#1928
…273) * Add docs for using the `--version` flag with the installation script Document how to use the changes per yarnpkg/yarn#1928 * Actually pass arguments to the script rather than curl
…(#273) * Add docs for using the `--version` flag with the installation script Document how to use the changes per yarnpkg/yarn#1928 * Actually pass arguments to the script rather than curl
Summary
Adds a --version flag to the installation script, expanding on the nightly flag added in #1554. When provided, the script will download the specified build of Yarn, rather than the stable released version. It grabs them from the downloads directory as specified in #1724 (comment) and updates the version check to reflect if the user has installed the same version (regardless of flags provided) in the user's home directory. The speed of this script is ~1 minute faster compared to using
npm
and provides an alternative to switching versions to help with #1724 as well.Test plan
./install-latest.sh
gets latest release version (0.16.1
),./install-latest.sh --nightly
gets latest nightly build (0.18.0-20161117.1624 right now),./install-latest.sh --version 0.17.4
installs0.17.4
.