Skip to content

Commit

Permalink
chore: fix JS modules makefile to correctly delete dependency directo…
Browse files Browse the repository at this point in the history
…ries on build fail

Signed-off-by: Sandeep Nishad <[email protected]>
  • Loading branch information
sandeepnRES committed May 15, 2024
1 parent c23197c commit 69c9bf3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
10 changes: 6 additions & 4 deletions weaver/core/drivers/fabric-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build: .npmrc

protos-js:
mkdir -p protos-js && \
cp -r ../../../common/protos-js/common ./protos-js/ && \
(cp -r ../../../common/protos-js/common ./protos-js/ && \
cp -r ../../../common/protos-js/corda ./protos-js/ && \
cp -r ../../../common/protos-js/driver ./protos-js/ && \
cp -r ../../../common/protos-js/fabric ./protos-js/ && \
Expand All @@ -20,13 +20,15 @@ protos-js:
cp -r ../../../common/protos-js/networks ./protos-js/ && \
cp -r ../../../common/protos-js/peer ./protos-js/ && \
cp -r ../../../common/protos-js/relay ./protos-js/ && \
cp -r ../../../common/protos-js/package.json ./protos-js/
cp -r ../../../common/protos-js/package.json ./protos-js/) || \
(rm -rf protos-js && echo "Error: Please build weaver/common/protos-js locally" && exit 1)

cacti-weaver-sdk-fabric: protos-js
mkdir -p cacti-weaver-sdk-fabric && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/build ./cacti-weaver-sdk-fabric/ && \
(cp -r ../../../sdks/fabric/interoperation-node-sdk/build ./cacti-weaver-sdk-fabric/ && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/index.js ./cacti-weaver-sdk-fabric/ && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/package.json ./cacti-weaver-sdk-fabric/package.json
cp -r ../../../sdks/fabric/interoperation-node-sdk/package.json ./cacti-weaver-sdk-fabric/package.json) || \
(rm -rf cacti-weaver-sdk-fabric && echo "Error: Please build weaver/sdks/fabric/interoperation-node-sdk locally" && exit 1)

build-local: cacti-weaver-sdk-fabric
cp package.json package-remote.json
Expand Down
10 changes: 6 additions & 4 deletions weaver/core/identity-management/iin-agent/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build: .npmrc

protos-js:
mkdir -p protos-js && \
cp -r ../../../common/protos-js/common ./protos-js/ && \
(cp -r ../../../common/protos-js/common ./protos-js/ && \
cp -r ../../../common/protos-js/corda ./protos-js/ && \
cp -r ../../../common/protos-js/driver ./protos-js/ && \
cp -r ../../../common/protos-js/identity ./protos-js/ && \
Expand All @@ -21,13 +21,15 @@ protos-js:
cp -r ../../../common/protos-js/networks ./protos-js/ && \
cp -r ../../../common/protos-js/peer ./protos-js/ && \
cp -r ../../../common/protos-js/relay ./protos-js/ && \
cp -r ../../../common/protos-js/package.json ./protos-js/
cp -r ../../../common/protos-js/package.json ./protos-js/) || \
(rm -rf protos-js && echo "Error: Please build weaver/common/protos-js locally" && exit 1)

cacti-weaver-sdk-fabric:
mkdir -p cacti-weaver-sdk-fabric && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/build ./cacti-weaver-sdk-fabric/ && \
(cp -r ../../../sdks/fabric/interoperation-node-sdk/build ./cacti-weaver-sdk-fabric/ && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/index.js ./cacti-weaver-sdk-fabric/ && \
cp -r ../../../sdks/fabric/interoperation-node-sdk/package.json ./cacti-weaver-sdk-fabric/package.json
cp -r ../../../sdks/fabric/interoperation-node-sdk/package.json ./cacti-weaver-sdk-fabric/package.json) || \
(rm -rf cacti-weaver-sdk-fabric && echo "Error: Please build weaver/sdks/fabric/interoperation-node-sdk locally" && exit 1)

build-local: protos-js cacti-weaver-sdk-fabric
(cp package.json package-remote.json && \
Expand Down
5 changes: 3 additions & 2 deletions weaver/sdks/besu/node/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build: .npmrc
.PHONY: build-local
build-local:
mkdir -p protos-js && \
cp -r ../../../common/protos-js/common ./protos-js/ && \
(cp -r ../../../common/protos-js/common ./protos-js/ && \
cp -r ../../../common/protos-js/corda ./protos-js/ && \
cp -r ../../../common/protos-js/driver ./protos-js/ && \
cp -r ../../../common/protos-js/fabric ./protos-js/ && \
Expand All @@ -15,7 +15,8 @@ build-local:
cp -r ../../../common/protos-js/peer ./protos-js/ && \
cp -r ../../../common/protos-js/relay ./protos-js/ && \
cp -r ../../../common/protos-js/identity ./protos-js/ && \
cp -r ../../../common/protos-js/package.json ./protos-js/
cp -r ../../../common/protos-js/package.json ./protos-js/) || \
(rm -rf protos-js && echo "Error: Please build weaver/common/protos-js locally" && exit 1)
(cp package.json package-remote.json && \
cp package-local.json package.json && \
npm install --workspaces=false && \
Expand Down
5 changes: 3 additions & 2 deletions weaver/sdks/fabric/interoperation-node-sdk/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build: .npmrc
.PHONY: build-local
build-local:
mkdir -p protos-js && \
cp -r ../../../common/protos-js/common ./protos-js/ && \
(cp -r ../../../common/protos-js/common ./protos-js/ && \
cp -r ../../../common/protos-js/corda ./protos-js/ && \
cp -r ../../../common/protos-js/driver ./protos-js/ && \
cp -r ../../../common/protos-js/fabric ./protos-js/ && \
Expand All @@ -15,7 +15,8 @@ build-local:
cp -r ../../../common/protos-js/peer ./protos-js/ && \
cp -r ../../../common/protos-js/relay ./protos-js/ && \
cp -r ../../../common/protos-js/identity ./protos-js/ && \
cp -r ../../../common/protos-js/package.json ./protos-js/
cp -r ../../../common/protos-js/package.json ./protos-js/) || \
(rm -rf protos-js && echo "Error: Please build weaver/common/protos-js locally" && exit 1)
(cp package.json package-remote.json && \
cp package-local.json package.json && \
npm install --workspaces=false && \
Expand Down

0 comments on commit 69c9bf3

Please sign in to comment.