sourcecred/scripts
William Chargin 2be413b77c
Unify a command-line entry point module (#344)
Summary:
For now, this contains the logic to register an `unhandledRejection`
error. I’ve removed all instances of those handlers, and `require`d this
module at every top-level entry point. (The individual CLI commands had
the handler before, but didn’t need it; conversely, the top-level CLI
entry point did not have the handler, but should have.)

Test Plan:
To test that the CLI commands still error on unhandled rejections, apply
the following patch:

```diff
diff --git a/src/v1/cli/commands/combine.js b/src/v1/cli/commands/combine.js
index b60f91e..d55b965 100644
--- a/src/v1/cli/commands/combine.js
+++ b/src/v1/cli/commands/combine.js
@@ -24,6 +24,7 @@ export default class CombineCommand extends Command {
     "  where each GRAPH is a JSON file generated by plugin-graph";

   async run() {
+    Promise.reject("wat");
     const {argv} = this.parse(CombineCommand);
     combine(argv);
   }
```

Then run `yarn backend` and `node bin/sourcecred.js`, and note that the
rejection handler is triggered.

wchargin-branch: unify-entry
2018-06-05 11:11:48 -07:00
..
backend.js Unify a command-line entry point module (#344) 2018-06-05 11:11:48 -07:00
build.js Unify a command-line entry point module (#344) 2018-06-05 11:11:48 -07:00
check-stopships.sh Check for STOPSHIPs in CI (#301) 2018-05-25 19:27:31 -07:00
ensure-flow.sh Fix `ensure-flow.sh` running under Node (#314) 2018-05-29 12:20:53 -07:00
start.js Unify a command-line entry point module (#344) 2018-06-05 11:11:48 -07:00
test.js Unify a command-line entry point module (#344) 2018-06-05 11:11:48 -07:00