mirror of
https://github.com/balena-io/open-balena.git
synced 2025-01-03 04:26:40 +00:00
709d00b898
The quickstart script should be able to run on macOS machines and not just Linux ones. Signed-off-by: Rich Bayliss <rich@balena.io> Change-type: patch
25 lines
403 B
Bash
25 lines
403 B
Bash
#!/bin/bash -e
|
|
|
|
REALPATH=
|
|
REALPATHS=(
|
|
'realpath'
|
|
'grealpath'
|
|
'greadlink -f'
|
|
)
|
|
for cmd in "${REALPATHS[@]}"; do
|
|
if command -v "${cmd%% *}" &>/dev/null; then
|
|
REALPATH="${cmd}"
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ -z "${REALPATH}" ]; then
|
|
local RED=`tput setaf 1`
|
|
echo "${RED}ERROR: Unable to find suitable command for realpath."
|
|
exit 1
|
|
fi
|
|
|
|
realpath() {
|
|
echo $(command ${REALPATH} "$@")
|
|
}
|