Skip to content

Commit

Permalink
Add --nightly flag to install script
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel15 committed Oct 30, 2016
1 parent 08f4284 commit 47364fc
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scripts/install-latest.sh
Expand Up @@ -9,7 +9,12 @@ white="\e[0;37m"

yarn_get_tarball() {
printf "$cyan> Downloading tarball...$reset\n"
curl -L -o yarn.tar.gz "https://yarnpkg.com/latest.tar.gz" >/dev/null # get tarball
if [ "$1" = '--nightly' ]; then
url=https://nightly.yarnpkg.com/latest.tar.gz
else
url=https://yarnpkg.com/latest.tar.gz
fi
curl -L -o yarn.tar.gz "$url" >/dev/null # get tarball

printf "$cyan> Extracting to ~/.yarn...$reset\n"
mkdir .yarn
Expand Down Expand Up @@ -42,7 +47,12 @@ yarn_link() {
echo "> If this isn't the profile of your current shell then please add the following to your correct profile:"
printf " $SOURCE_STR$reset\n"

printf "$green> Successfully installed! Please open another terminal where the \`yarn\` command will now be available.$reset\n"
version=`./.yarn/bin/yarn --version` || (
printf "$red> Yarn was installed, but doesn't seem to be working :(.$reset\n"
exit 1;
)

printf "$green> Successfully installed Yarn $version! Please open another terminal where the \`yarn\` command will now be available.$reset\n"
fi
}

Expand Down Expand Up @@ -101,10 +111,10 @@ yarn_install() {
exit 0
fi

yarn_get_tarball
yarn_get_tarball $1
yarn_link
yarn_reset
}

cd ~
yarn_install
yarn_install $1

0 comments on commit 47364fc

Please sign in to comment.