From 9e243c74ed05377ae46d3ba58ef490888e4ffd8e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 3 May 2021 15:00:38 -0700 Subject: [PATCH] =?UTF-8?q?shell:=20Replace=20=E2=80=98which=E2=80=99=20ut?= =?UTF-8?q?ility=20with=20=E2=80=98command=20-v=E2=80=99=20shell=20builtin?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- Vagrantfile | 7 +------ tools/ci/Dockerfile.template | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 14cc0af078..54f495e367 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,13 +2,8 @@ VAGRANTFILE_API_VERSION = "2" -def command?(name) - `which #{name} > /dev/null 2>&1` - $?.success? -end - if Vagrant::VERSION == "1.8.7" - path = `which curl` + path = `command -v curl` if path.include?("/opt/vagrant/embedded/bin/curl") puts "In Vagrant 1.8.7, curl is broken. Please use Vagrant 2.0.2 " \ "or run 'sudo rm -f /opt/vagrant/embedded/bin/curl' to fix the " \ diff --git a/tools/ci/Dockerfile.template b/tools/ci/Dockerfile.template index f18af72d69..93d50589f0 100644 --- a/tools/ci/Dockerfile.template +++ b/tools/ci/Dockerfile.template @@ -59,7 +59,7 @@ RUN set -e \ && tar -xz -C /tmp -f /tmp/docker.tgz \ && mv /tmp/docker/* /usr/bin \ && rm -rf /tmp/docker /tmp/docker.tgz \ - && which docker \ + && command -v docker \ && (docker version 2>/dev/null || true) # ...docker-compose...