mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-07 18:25:19 +00:00
Discourse: CLI cleanup (#1448)
- Remove username from help text. - Simplify projectId generation.
This commit is contained in:
parent
d6fb58bf2c
commit
8e693a942d
@ -78,15 +78,11 @@ const command: Command = async (args, std) => {
|
||||
return die(std, "Expected one positional arguments (or --help).");
|
||||
}
|
||||
const [serverUrl] = positionalArgs;
|
||||
let projectId = serverUrl;
|
||||
if (projectId.startsWith("https://")) {
|
||||
projectId = projectId.slice("https://".length);
|
||||
} else if (projectId.startsWith("http://")) {
|
||||
projectId = projectId.slice("http://".length);
|
||||
} else {
|
||||
const httpRE = new RegExp(/^https?:\/\//);
|
||||
if (!httpRE.test(serverUrl)) {
|
||||
die(std, "expected server url to start with 'https://' or 'http://'");
|
||||
}
|
||||
|
||||
const projectId = serverUrl.trim().replace(httpRE, "");
|
||||
const project: Project = {
|
||||
id: projectId,
|
||||
repoIds: [],
|
||||
|
@ -20,7 +20,6 @@ function usage(print: (string) => void): void {
|
||||
usage: sourcecred gen-project PROJECT_ID
|
||||
[--github GITHUB_SPEC [...]]
|
||||
[--discourse-url DISCOURSE_URL]
|
||||
[--discourse-username DISCOURSE_USERNAME]
|
||||
sourcecred gen-project --help
|
||||
|
||||
Generates a SourceCred project configuration based on the provided specs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user