mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-14 13:36:50 +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).");
|
return die(std, "Expected one positional arguments (or --help).");
|
||||||
}
|
}
|
||||||
const [serverUrl] = positionalArgs;
|
const [serverUrl] = positionalArgs;
|
||||||
let projectId = serverUrl;
|
const httpRE = new RegExp(/^https?:\/\//);
|
||||||
if (projectId.startsWith("https://")) {
|
if (!httpRE.test(serverUrl)) {
|
||||||
projectId = projectId.slice("https://".length);
|
|
||||||
} else if (projectId.startsWith("http://")) {
|
|
||||||
projectId = projectId.slice("http://".length);
|
|
||||||
} else {
|
|
||||||
die(std, "expected server url to start with 'https://' or 'http://'");
|
die(std, "expected server url to start with 'https://' or 'http://'");
|
||||||
}
|
}
|
||||||
|
const projectId = serverUrl.trim().replace(httpRE, "");
|
||||||
const project: Project = {
|
const project: Project = {
|
||||||
id: projectId,
|
id: projectId,
|
||||||
repoIds: [],
|
repoIds: [],
|
||||||
|
@ -20,7 +20,6 @@ function usage(print: (string) => void): void {
|
|||||||
usage: sourcecred gen-project PROJECT_ID
|
usage: sourcecred gen-project PROJECT_ID
|
||||||
[--github GITHUB_SPEC [...]]
|
[--github GITHUB_SPEC [...]]
|
||||||
[--discourse-url DISCOURSE_URL]
|
[--discourse-url DISCOURSE_URL]
|
||||||
[--discourse-username DISCOURSE_USERNAME]
|
|
||||||
sourcecred gen-project --help
|
sourcecred gen-project --help
|
||||||
|
|
||||||
Generates a SourceCred project configuration based on the provided specs.
|
Generates a SourceCred project configuration based on the provided specs.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user