mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-07 10:15:10 +00:00
ff2d4f2fd8
Summary: This commit includes a minimal usage of an actual CLI application. It provides the `help` command and no actual functionality. Test Plan: Unit tests added, with full coverage. To see it in action, first run `yarn backend`, then run `node bin/cli.js help`. wchargin-branch: cli-beginnings
23 lines
572 B
JavaScript
23 lines
572 B
JavaScript
// @flow
|
|
|
|
import {handlingErrors} from "./command";
|
|
import sourcecred from "./sourcecred";
|
|
|
|
require("../tools/entry");
|
|
|
|
export default function main(): Promise<void> {
|
|
return handlingErrors(sourcecred)(process.argv.slice(2), {
|
|
out: (x) => console.log(x),
|
|
err: (x) => console.error(x),
|
|
}).then((exitCode) => {
|
|
process.exitCode = exitCode;
|
|
});
|
|
}
|
|
|
|
// Only run in the Webpack bundle, not as a Node module (during tests).
|
|
/* istanbul ignore next */
|
|
/*:: declare var __webpack_require__: mixed; */
|
|
if (typeof __webpack_require__ !== "undefined") {
|
|
main();
|
|
}
|