We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 299427a commit faa08bdCopy full SHA for faa08bd
rustup-init.sh
@@ -331,11 +331,16 @@ err() {
331
}
332
333
need_cmd() {
334
- if ! command -v "$1" > /dev/null 2>&1
+ if ! check_cmd "$1"
335
then err "need '$1' (command not found)"
336
fi
337
338
339
+check_cmd() {
340
+ command -v "$1" > /dev/null 2>&1
341
+ return $?
342
+}
343
+
344
need_ok() {
345
if [ $? != 0 ]; then err "$1"; fi
346
@@ -362,9 +367,9 @@ ignore() {
362
367
# This wraps curl or wget. Try curl first, if not installed,
363
368
# use wget instead.
364
369
downloader() {
365
- if command -v curl > /dev/null 2>&1
370
+ if check_cmd curl
366
371
then _dld=curl
- elif command -v wget > /dev/null 2>&1
372
+ elif check_cmd wget
373
then _dld=wget
374
else _dld='curl or wget' # to be used in error message of need_cmd
375
0 commit comments