From 0c2de7738ee196cf43d5e5df30f795af6db11b3f Mon Sep 17 00:00:00 2001
From: Andrew Ferrazzutti <andrewf@element.io>
Date: Fri, 15 Sep 2023 03:30:58 -0400
Subject: [PATCH] Improve "yarn start" (#900)

* Don't force build before start

* Let "yarn start/debug" accept config file path arg

Also use "yarn start" in the README

* changelog
---
 README.md            | 2 +-
 changelog.d/900.misc | 1 +
 package.json         | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 changelog.d/900.misc

diff --git a/README.md b/README.md
index 84587d1..934ed5f 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,7 @@ by running ``yarn set version classic`` in the directory where you cloned this r
       homeserverUrl: "https://example.com"
   ```
 
-* Run ``node build/src/discordas.js -r -u "http://localhost:9005" -c config.yaml``
+* Run ``yarn start -r -u "http://localhost:9005"``
 * Modify your HSs appservices config so that it includes the generated file.
   * e.g. On synapse, adding to ``app_service_config_files`` array in ``homeserver.yaml``
 
diff --git a/changelog.d/900.misc b/changelog.d/900.misc
new file mode 100644
index 0000000..75ccd70
--- /dev/null
+++ b/changelog.d/900.misc
@@ -0,0 +1 @@
+Modify the "start" and "debug" package scripts to not trigger a TypeScript build, and to accept a user-supplied command line option for the path to the bridge configuration file.
diff --git a/package.json b/package.json
index 15fbd6c..86f4c72 100644
--- a/package.json
+++ b/package.json
@@ -13,8 +13,8 @@
     "coverage": "tsc && nyc mocha build/test/config.js build/test",
     "build": "tsc",
     "postinstall": "yarn build",
-    "start": "yarn build && node ./build/src/discordas.js -c config.yaml",
-    "debug": "yarn build && node --inspect ./build/src/discordas.js -c config.yaml",
+    "start": "node ./build/src/discordas.js",
+    "debug": "node --inspect ./build/src/discordas.js",
     "addbot": "node ./build/tools/addbot.js",
     "adminme": "node ./build/tools/adminme.js",
     "usertool": "node ./build/tools/userClientTools.js",
-- 
GitLab