From cafd217630fb50f13c9b5a1461d1b84a54c4c4d4 Mon Sep 17 00:00:00 2001 From: lathan britz Date: Wed, 31 Aug 2022 19:18:56 -0400 Subject: [PATCH] fix yarn peer [add|ls|remove] commands dont return shell #6 --- src/cmd/peer/AddPeer.ts | 1 + src/cmd/peer/ListPeers.ts | 1 + src/cmd/peer/RemovePeer.ts | 1 + src/cmd/peer/ShowPeer.ts | 1 + 4 files changed, 4 insertions(+) diff --git a/src/cmd/peer/AddPeer.ts b/src/cmd/peer/AddPeer.ts index 2305b15..0bdb538 100644 --- a/src/cmd/peer/AddPeer.ts +++ b/src/cmd/peer/AddPeer.ts @@ -28,6 +28,7 @@ const addPeer = async (argv: any): Promise => { } else { console.error('Error: System config url is required') } + process.exit(1) } const printPeer = async (peer: IPeer): Promise => { diff --git a/src/cmd/peer/ListPeers.ts b/src/cmd/peer/ListPeers.ts index 4d3c91e..989707a 100644 --- a/src/cmd/peer/ListPeers.ts +++ b/src/cmd/peer/ListPeers.ts @@ -5,6 +5,7 @@ const listPeer = async (): Promise => { Peer.find({}, '-_id -certificate -fingerprint', (error, peers) => { printPeers(peers) }) + process.exit(1) } const printPeers = async (peers: IPeer[]): Promise => { diff --git a/src/cmd/peer/RemovePeer.ts b/src/cmd/peer/RemovePeer.ts index e3f4f5f..a7e74e2 100644 --- a/src/cmd/peer/RemovePeer.ts +++ b/src/cmd/peer/RemovePeer.ts @@ -12,6 +12,7 @@ const removePeer = async (argv: any): Promise => { } }) } + process.exit(1) } const RemovePeerCommand = { diff --git a/src/cmd/peer/ShowPeer.ts b/src/cmd/peer/ShowPeer.ts index 8b30d5a..ac9f9d2 100644 --- a/src/cmd/peer/ShowPeer.ts +++ b/src/cmd/peer/ShowPeer.ts @@ -11,6 +11,7 @@ const showPeer = async (argv: any): Promise => { console.error(`${chalk.red('Error:')} Peer not found: ${argv.node_id}`) } } + process.exit(1) } const printPeer = async (peer: IPeer): Promise => {