install-node: Silence expected “node: command not found” on first run.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-11-03 10:15:10 -07:00 committed by Tim Abbott
parent d494181127
commit 7021852627
3 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ check_version() {
out="$(node --version)" && [ "$out" = "v$version" ]
}
if ! check_version; then
if ! check_version 2>/dev/null; then
tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir"

View File

@ -10,12 +10,12 @@ declare -A sha256=(
)
check_version() {
out="$(shellcheck --version 2>/dev/null)" && [[ "$out" = *"
out="$(shellcheck --version)" && [[ "$out" = *"
version: $version
"* ]]
}
if ! check_version; then
if ! check_version 2>/dev/null; then
tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir"

View File

@ -17,10 +17,10 @@ case $arch in
esac
check_version() {
out="$(shfmt --version 2>/dev/null)" && [ "$out" = "v$version" ]
out="$(shfmt --version)" && [ "$out" = "v$version" ]
}
if ! check_version; then
if ! check_version 2>/dev/null; then
tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir"