From 03453f3ab4e485198a3f82d73aa4aa810e659994 Mon Sep 17 00:00:00 2001 From: dzdidi Date: Mon, 5 Feb 2024 17:26:32 +0000 Subject: [PATCH] No self dox unless necessary Signed-off-by: dzdidi --- src/git-remote-pear.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/git-remote-pear.js b/src/git-remote-pear.js index 31ac3a7..6aac563 100755 --- a/src/git-remote-pear.js +++ b/src/git-remote-pear.js @@ -28,7 +28,11 @@ const targetKey = matches[1] const repoName = matches[2] const store = new Corestore(RAM) -const swarm = new Hyperswarm({ keyPair: home.getKeyPair() }) +const swarmOpts = {} +if (process.env.GIT_PEAR_AUTH && process.env.GIT_PEAR_AUTH !== 'native') { + swarmOpts.keyPair = home.getKeyPair() +} +const swarm = new Hyperswarm(swarmOpts) if (!home.isDaemonRunning()) { console.error('Please start git pear daemon')