Merge pull request #45 from roman-mazur/roman/fix-build

scripts: Handle missing coreutils on Mac
This commit is contained in:
dfunckt 2019-04-18 15:28:19 +03:00 committed by GitHub
commit 98b6100fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,11 @@
#!/bin/bash -e
echo_error() {
local RED=`tput setaf 1`
local RESET=`tput sgr0`
echo "${RED}ERROR: ${1}${RESET}"
}
REALPATH=
REALPATHS=(
'realpath'
@ -14,8 +20,13 @@ fi
done
if [ -z "${REALPATH}" ]; then
local RED=`tput setaf 1`
echo "${RED}ERROR: Unable to find suitable command for realpath."
echo_error 'Unable to find suitable command for realpath.'
if [ $(uname) == 'Darwin' ]; then
echo 'GNU coreutils are required to build openBalena on MacOS. To install with brew, run'
echo ''
echo ' brew install coreutils'
echo ''
fi
exit 1
fi