From 3fe1e0e26ea9bcaf77b24ea9378c41bd55d061a4 Mon Sep 17 00:00:00 2001
From: Audric Ackermann <audric@loki.network>
Date: Wed, 20 May 2020 10:56:18 +1000
Subject: [PATCH] clean package.json. use MULTI env variable to start different
 instances

---
 CONTRIBUTING.md |  4 ++--
 package.json    | 13 +++----------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7a13f984f..437d4e87a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -94,9 +94,9 @@ There are a few scripts which you can use:
 
 ```
 yarn start - Start development
-yarn start-multi - Start second instance of development
+MULTI=1 yarn start - Start second instance of development
 yarn start-prod - Start production but in development mode
-yarn start-prod-multi - Start another instance of production
+MULTI=1 yarn start-prod - Start another instance of production
 ```
 
 For more than 2 clients, you may run the above command with `NODE_APP_INSTANCE` set before them.
diff --git a/package.json b/package.json
index 4603dedd2..03a08e454 100644
--- a/package.json
+++ b/package.json
@@ -15,15 +15,9 @@
   "main": "main.js",
   "scripts": {
     "postinstall": "electron-builder install-app-deps && rimraf node_modules/dtrace-provider",
-    "start": "electron .",
-    "start-multi": "cross-env NODE_APP_INSTANCE=1 electron .",
-    "start-multi2": "cross-env NODE_APP_INSTANCE=2 electron .",
-    "start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod electron .",
-    "start-prod-multi": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod1 electron .",
-    "start-prod-multi-2": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod2 electron .",
-    "start-swarm-test": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=1 electron .",
-    "start-swarm-test-2": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=2 electron .",
-    "start-swarm-test-3": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=3 electron .",
+    "start": "cross-env NODE_APP_INSTANCE=$MULTI electron .",
+    "start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron .",
+    "start-swarm-test": "cross-env NODE_ENV=production NODE_APP_INSTANCE=$MULTI electron .",
     "grunt": "grunt",
     "icon-gen": "electron-icon-maker --input=images/icon_1024.png --output=./build",
     "generate": "yarn icon-gen && yarn grunt",
@@ -38,7 +32,6 @@
     "test-loki-view": "NODE_ENV=test-loki yarn run start",
     "test-electron": "yarn grunt test",
     "test-integration": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js",
-    "test-integration-parts": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js --grep 'registration' && ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js --grep 'openGroup' && ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js --grep 'addFriends' && ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js --grep 'linkDevice' && ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js --grep 'closedGroup'",
     "test-node": "mocha --recursive --exit test/app test/modules ts/test libloki/test/node",
     "eslint": "eslint --cache .",
     "eslint-fix": "eslint --fix .",