migrate.rb: work on Linux, too

What does this MR do and why?

migrate.rb always fails on Linux because command isn't a binary on it.

system("command", "-v", command, out: File::NULL) is actually executing the command binary on PATH (!). macOS provides one at /usr/bin/command which is just this shell script:

#!/bin/sh
# $FreeBSD$
# This file is in the public domain.
builtin `echo ${0##*/} | tr \[:upper:] \[:lower:]` ${1+"$@"}

Lol! Anyway. It's not there on Linux! Let's just call which instead, which is present on PATH on both macOS and Linux.

(The alternative would be to use the shell form of Kernel#system, but why involve a shell when we can avoid it.)

Screenshots or screen recordings

Before After
image image

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading