make: fix building source tarball on macos

Unfortunately, `readlink -f` doesn't work on macos. This change *manually*
converts a relative path to an absolute path.

fixes #5859

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen 2018-12-19 10:59:47 -08:00
parent 3f6925dfce
commit daff837886

View File

@ -5,7 +5,11 @@
set -euo pipefail
IFS=$'\n\t'
OUTPUT="$(readlink -f "${1:-go-ipfs-source.tar.gz}")"
# readlink doesn't work on macos
OUTPUT="${1:-go-ipfs-source.tar.gz}"
if ! [[ "$OUTPUT" = /* ]]; then
OUTPUT="$PWD/$OUTPUT"
fi
TMPDIR="$(mktemp -d)"
NEWIPFS="$TMPDIR/src/github.com/ipfs/go-ipfs"