From 6d7afb03cd7602b60e709516711a2f94cd61ff25 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 3 Feb 2021 13:00:27 -0800 Subject: [PATCH] pass -q to curl calls to disable user .curlrc files PR-URL: https://github.com/npm/cli/pull/2613 Credit: @nlf Close: #2613 Reviewed-by: @ljharb, @wraithgar --- README.md | 4 ++-- scripts/install.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9350087f62cd..3b6b30513db5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ You can download & install **`npm`** directly from [**npmjs**.com](https://npmjs.com/) using our custom `install.sh` script: ```bash -curl -L https://www.npmjs.com/install.sh | sh +curl -qL https://www.npmjs.com/install.sh | sh ``` #### Node Version Managers @@ -50,4 +50,4 @@ npm ### Acknowledgments * `npm` is configured to use the **npm Public Registry** at [https://registry.npmjs.org](https://registry.npmjs.org) by default; Usage of this registry is subject to **Terms of Use** available at [https://npmjs.com/policies/terms](https://npmjs.com/policies/terms) -* You can configure `npm` to use any other compatible registry you prefer. You can read more about configuring third-party registries [here](https://docs.npmjs.com/cli/v7/using-npm/registry) \ No newline at end of file +* You can configure `npm` to use any other compatible registry you prefer. You can read more about configuring third-party registries [here](https://docs.npmjs.com/cli/v7/using-npm/registry) diff --git a/scripts/install.sh b/scripts/install.sh index 4458de87faef..8c0ba3de72f1 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -18,7 +18,7 @@ if [ "x$0" = "xsh" ]; then # which is a bit cuter. But on others, &1 is already closed, # so catting to another script file won't do anything. # Follow Location: headers, and fail on errors - curl -f -L -s https://www.npmjs.org/install.sh > npm-install-$$.sh + curl -q -f -L -s https://www.npmjs.org/install.sh > npm-install-$$.sh ret=$? if [ $ret -eq 0 ]; then (exit 0) @@ -134,7 +134,7 @@ fi # need to echo "" after, because Posix sed doesn't treat EOF # as an implied end of line. -url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \ +url=`(curl -qSsL https://registry.npmjs.org/npm/$t; echo "") \ | sed -e 's/^.*tarball":"//' \ | sed -e 's/".*$//'` @@ -142,7 +142,7 @@ ret=$? if [ "x$url" = "x" ]; then ret=125 # try without the -e arg to sed. - url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \ + url=`(curl -qSsL https://registry.npmjs.org/npm/$t; echo "") \ | sed 's/^.*tarball":"//' \ | sed 's/".*$//'` ret=$? @@ -159,7 +159,7 @@ fi echo "fetching: $url" >&2 cd "$TMP" \ - && curl -SsL -o npm.tgz "$url" \ + && curl -qSsL -o npm.tgz "$url" \ && $tar -xzf npm.tgz \ && cd "$TMP"/package \ && echo "removing existing npm" \