improve build_all.sh
diff --git a/torch/lib/build_all.sh b/torch/lib/build_all.sh
index 8922e68..0532123 100755
--- a/torch/lib/build_all.sh
+++ b/torch/lib/build_all.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
set -e
cd "$(dirname "$0")/../.."
@@ -88,13 +90,12 @@
cp -r tmp_install/include .
cp $INSTALL_DIR/bin/* .
-if [[ "$OSTYPE" == "linux-gnu"* ]]; then
- if [ "$PYTORCH_BINARY_BUILD" ]
- then
- echo "Copying over dependency libraries $PYTORCH_SO_DEPS"
- # copy over dependency libraries into the current dir
- cp -P $PYTORCH_SO_DEPS .
- else
- echo "Not binary build"
- fi
+# this is for binary builds
+if [[ $PYTORCH_BINARY_BUILD && $PYTORCH_SO_DEPS ]]
+then
+ echo "Copying over dependency libraries $PYTORCH_SO_DEPS"
+ # copy over dependency libraries into the current dir
+ cp -P $PYTORCH_SO_DEPS .
+else
+ echo "Not binary build"
fi