swtpm/tests/fileinstall
Stefan Berger 895df2c36e tests+samples: Check for --help support to determine stat/sed tools flavor
Using the kernel name was not a good choice for determining which flavor
(BSD vs. GNU) of stat, sed, and install was being used since one could
install either one of them at least on MacOS. Instead, check whether
--help is supported by these tools.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2026-05-19 19:14:37 -04:00

9 lines
134 B
Bash
Executable File

#!/usr/bin/env bash
if install --help &>/dev/null; then
install -D "$1" "$2"
else
mkdir -p "$(dirname "$2")"
install "$1" "$2"
fi