mirror of
https://github.com/zhigang1992/yarn.git
synced 2026-04-29 17:55:03 +08:00
Fixes two issues with the install script: (#2027)
- Old versions of Mac OS (10.10 and below) require the `-t` option for `mktemp` - The check for GPG wasn't returning correctly, and tried to run GPG even when not available Closes #2012 Closes #1984
This commit is contained in:
@@ -19,7 +19,7 @@ yarn_get_tarball() {
|
||||
url=https://yarnpkg.com/latest.tar.gz
|
||||
fi
|
||||
# Get both the tarball and its GPG signature
|
||||
tarball_tmp=`mktemp`
|
||||
tarball_tmp=`mktemp -t yarn.XXXXXXXXXX.tar.gz`
|
||||
curl -L -o "$tarball_tmp#1" "$url{,.asc}"
|
||||
yarn_verify_integrity $tarball_tmp
|
||||
|
||||
@@ -32,10 +32,10 @@ yarn_get_tarball() {
|
||||
# Verifies the GPG signature of the tarball
|
||||
yarn_verify_integrity() {
|
||||
# Check if GPG is installed
|
||||
command -v gpg >/dev/null 2>&1 || (
|
||||
if [[ -z "$(command -v gpg)" ]]; then
|
||||
printf "$yellow> WARNING: GPG is not installed, integrity can not be verified!$reset\n"
|
||||
return
|
||||
)
|
||||
fi
|
||||
|
||||
if [ "$YARN_GPG" == "no" ]; then
|
||||
printf "$cyan> WARNING: Skipping GPG integrity check!$reset\n"
|
||||
|
||||
Reference in New Issue
Block a user