Merge pull request #64 from dreimolo/macos_AS_fix
Macos apple silicon fix, and slight improvements to sample downloader
This commit is contained in:
commit
5bd3934d22
@ -44,11 +44,19 @@ dependencies {
|
||||
|
||||
protobuf {
|
||||
protoc {
|
||||
if (osdetector.os == "osx") {
|
||||
artifact = "com.google.protobuf:protoc:3.0.2:osx-x86_64"
|
||||
} else {
|
||||
artifact = "com.google.protobuf:protoc:3.0.2"
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
grpc {
|
||||
artifact = 'io.grpc:protoc-gen-grpc-java:1.1.2'
|
||||
if (osdetector.os == "osx") {
|
||||
artifact = "io.grpc:protoc-gen-grpc-java:1.1.2:osx-x86_64"
|
||||
} else {
|
||||
artifact = "io.grpc:protoc-gen-grpc-java:1.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,25 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Check if wget exists
|
||||
if command -v wget &> /dev/null; then
|
||||
dl_prg="wget -O"
|
||||
elif command -v curl &> /dev/null; then
|
||||
dl_prg="curl -o"
|
||||
else
|
||||
echo "Neither wget nor curl found, exiting .."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
"s"|"m"|"l"|"xl")
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument. Must be one of 's', 'm', 'l' or 'xl'."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
SAMPLE_NAME=crawl-${1:-m}
|
||||
SAMPLE_DIR="node-1/samples/${SAMPLE_NAME}/"
|
||||
|
||||
@ -11,7 +30,7 @@ function download_model {
|
||||
|
||||
if [ ! -f $model ]; then
|
||||
echo "** Downloading $url"
|
||||
wget -O $model $url
|
||||
$dl_prg $model $url
|
||||
fi
|
||||
}
|
||||
|
||||
@ -23,7 +42,7 @@ fi
|
||||
|
||||
mkdir -p node-1/samples/
|
||||
SAMPLE_TARBALL=samples/${SAMPLE_NAME}.tar.gz
|
||||
download_model ${SAMPLE_TARBALL} https://downloads.marginalia.nu/${SAMPLE_TARBALL} || rm ${SAMPLE_TARBALL}
|
||||
download_model ${SAMPLE_TARBALL}.tmp https://downloads.marginalia.nu/${SAMPLE_TARBALL} && mv ${SAMPLE_TARBALL}.tmp ${SAMPLE_TARBALL}
|
||||
|
||||
if [ ! -f ${SAMPLE_TARBALL} ]; then
|
||||
echo "!! Failed"
|
||||
|
@ -12,7 +12,8 @@ function download_model {
|
||||
|
||||
if [ ! -f $model ]; then
|
||||
echo "** Downloading $url"
|
||||
curl -s -o $model $url
|
||||
curl -s -o $model.tmp $url
|
||||
mv $model.tmp $model
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user