Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This patch creates a new binary, `./bin/sc2`, which will be the home for a rewrite of the CLI intended to implement an instance system. See: <https://discourse.sourcecred.io/t/sourcecred-instance-system/244> Paired with @decentralion. Test Plan: Run `yarn backend` and `node ./bin/sc2.js`, which should nicely fail with a “not yet implemented” message. wchargin-branch: cli2-skeleton wchargin-source: a76bc7625c5508b876e471f6c8a8f82363f76a12
- Loading branch information
1 parent
70a4597
commit 3db9b91
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// @flow | ||
|
||
export * from "../cli/command"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// @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; */ | ||
// eslint-disable-next-line camelcase | ||
if (typeof __webpack_require__ !== "undefined") { | ||
main(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// @flow | ||
// Implementation of the root `sourcecred` command. | ||
|
||
import type {Command} from "./command"; | ||
|
||
const sourcecred: Command = async (args, std) => { | ||
std.err("SourceCred CLI v2 not yet implemented"); | ||
return 1; | ||
}; | ||
|
||
export default sourcecred; |