#!/bin/bash set -e root=$(cd $(dirname ${0})/..; pwd) src=${root}/src tools=${root}/tools third_party=${root}/third_party identifier=caffe repository=https://github.com/BVLC/${identifier}.git mkdir -p ${third_party} if [ -d "${third_party}/${identifier}" ]; then git -C "${third_party}/${identifier}" fetch -p git -C "${third_party}/${identifier}" reset --hard origin/master else echo "Clone ${repository}..." git -C "${third_party}" clone --recursive ${repository} fi echo "Generate '../src/caffe.js'" ${root}/node_modules/protobufjs/bin/pbjs -t static-module -w closure -r caffe -o ${src}/caffe.js ${third_party}/${identifier}/src/caffe/proto/caffe.proto