|
|
@@ -0,0 +1,22 @@
|
|
|
+#!/bin/bash
|
|
|
+
|
|
|
+mkdir -p ../third_party
|
|
|
+
|
|
|
+repository=https://github.com/caffe2/caffe2.git
|
|
|
+
|
|
|
+if [ -d "../third_party/caffe2" ]; then
|
|
|
+ pushd "../third_party/${identifier}" > /dev/null
|
|
|
+ echo "Fetch ${repository}..."
|
|
|
+ git fetch -p
|
|
|
+ echo "Reset ${repository}..."
|
|
|
+ git reset --hard origin/master
|
|
|
+ popd > /dev/null
|
|
|
+else
|
|
|
+ echo "Clone ${repository}..."
|
|
|
+ pushd "../third_party" > /dev/null
|
|
|
+ git clone --recursive ${repository}
|
|
|
+ popd > /dev/null
|
|
|
+fi
|
|
|
+
|
|
|
+echo "Generate '../src/caffe2.js'"
|
|
|
+../node_modules/protobufjs/bin/pbjs -t static-module -w closure -r caffe2 -o ../src/caffe2.js ../third_party/caffe2/caffe2/proto/caffe2.proto
|