diff --git a/code/api/index-api/build.gradle b/code/api/index-api/build.gradle index 37d76aa0..51205960 100644 --- a/code/api/index-api/build.gradle +++ b/code/api/index-api/build.gradle @@ -44,11 +44,19 @@ dependencies { protobuf { protoc { - artifact = "com.google.protobuf:protoc:3.0.2" + 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" + } } } diff --git a/run/download-samples.sh b/run/download-samples.sh index 66aa6125..bbae77e6 100755 --- a/run/download-samples.sh +++ b/run/download-samples.sh @@ -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" diff --git a/run/setup.sh b/run/setup.sh index 1163d4b4..b9e22b22 100755 --- a/run/setup.sh +++ b/run/setup.sh @@ -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 }