Преглед на файлове

Caffe2 clone and protobuf generator script

Lutz Roeder преди 8 години
родител
ревизия
b6ae9f8639
променени са 1 файла, в които са добавени 22 реда и са изтрити 0 реда
  1. 22 0
      tools/caffe2-generate

+ 22 - 0
tools/caffe2-generate

@@ -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