File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed
Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ USAGE=" usage: fle.sh <command>
4+
5+ commands:
6+ link [--build-libmongocrypt]: (optionally builds libmongocrypt), builds the node bindings and links the bindings to the driver
7+ rebuild: rebuilds the node bindings
8+ unlink: unlinks the node bindings from the driver
9+
10+ required environment variables:
11+ FLE_BINDINGS_PATH - a path, relative or absolute, to the directory that contains the Node libmongocrypt bindings"
12+
13+ build_libmongocrypt () {
14+ cd $FLE_BINDINGS_PATH
15+ # clean out any stale builds
16+ git clean -fdx
17+ bash etc/build-static.sh
18+ cd -
19+ }
20+
21+ build_node_bindings () {
22+ cd $FLE_BINDINGS_PATH
23+ npm run rebuild
24+ cd -
25+ }
26+
27+ link_bindings () {
28+ npm link $FLE_BINDINGS_PATH
29+ }
30+
31+ unlink_bindings () {
32+ npm unlink $FLE_BINDINGS_PATH
33+ }
34+
35+ if [[ " $FLE_BINDINGS_PATH " == " " ]]; then
36+ echo " FLE_BINDINGS_PATH path must be set."
37+ exit 1
38+ fi
39+
40+ case $1 in
41+ " link" )
42+ if [[ " $2 " == " --build-libmongocrypt" ]]; then
43+ build_libmongocrypt
44+ fi
45+
46+ build_node_bindings
47+ link_bindings
48+ ;;
49+ " rebuild" )
50+ build_node_bindings
51+ ;;
52+ " unlink" )
53+ unlink_bindings
54+ ;;
55+ * )
56+ echo " $USAGE "
57+ ;;
58+ esac
You can’t perform that action at this time.
0 commit comments