From 41d6c4e451cabcddac63307519599f599e4b4daa Mon Sep 17 00:00:00 2001 From: Brandon Sprague Date: Sun, 28 Apr 2024 06:11:26 -0700 Subject: [PATCH] Invoke curl without using user's ~/.curlrc config (#224) The idea is that a `~/.curlrc` can contain options that change the output, like `-w`, which can cause downstream tooling (like `tar`) to fail. In this case, we want `curl` to behave consistently regardless of how the user has configured curl. Fix #223 --- functions/_nvm_index_update.fish | 2 +- functions/nvm.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/_nvm_index_update.fish b/functions/_nvm_index_update.fish index c1bbe28..c66753d 100644 --- a/functions/_nvm_index_update.fish +++ b/functions/_nvm_index_update.fish @@ -3,7 +3,7 @@ function _nvm_index_update set --local index $nvm_data/.index - if not command curl --location --silent $nvm_mirror/index.tab >$index.temp + if not command curl -q --location --silent $nvm_mirror/index.tab >$index.temp command rm -f $index.temp echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2 return 1 diff --git a/functions/nvm.fish b/functions/nvm.fish index 179dc45..b0a7fdb 100644 --- a/functions/nvm.fish +++ b/functions/nvm.fish @@ -113,7 +113,7 @@ function nvm --description "Node version manager" echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m" end - if ! command curl $silent --progress-bar --location $url | + if ! command curl -q $silent --progress-bar --location $url | command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null command rm -rf $nvm_data/$ver echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2