Skip to content

Commit 0691594

Browse files
authored
feat: --octoherd-debug flag (#12)
1 parent 26180ea commit 0691594

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$ octoherd.js [script] [repos...]
1111
1212
Positionals:
13-
script Path to your *.js script
13+
script Path to *.js script. Must be an ES Module.
1414
repos One or multiple arrays in the form of 'repo-owner/repo-name'.
1515
'repo-owner/*' will find all repositories for one owner. '*' will find
1616
all repositories the user has access to [default: []]
@@ -21,6 +21,7 @@ Options:
2121
--octoherd-token Requires the "public_repo" scope for public repositories,
2222
"repo" scope for private repositories. [string] [required]
2323
--octoherd-cache Cache responses for debugging [boolean] [default: false]
24+
--octoherd-debug Show debug logs [boolean] [default: false]
2425
```
2526

2627
The `script` must export a `script` function which takes three parameters:

bin/octoherd.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const argv = yargs
3232
type: "boolean",
3333
default: false,
3434
})
35+
.option("octoherd-debug", {
36+
description: "Show debug logs",
37+
type: "boolean",
38+
default: false,
39+
})
3540
.epilog("copyright 2020").argv;
3641

3742
const { _, $0, script, repos, ...options } = argv;

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ export async function octoherd(
3333
) {
3434
const {
3535
octoherdToken,
36-
octoherdScript,
3736
octoherdCache,
37+
octoherdDebug,
38+
octoherdScript,
3839
octoherdRepos,
3940
...userOptions
4041
} = options;
@@ -47,7 +48,7 @@ export async function octoherd(
4748
auth: octoherdToken,
4849
userAgent: ["octoherd-cli", VERSION].join("/"),
4950
octoherd: {
50-
debug: true,
51+
debug: octoherdDebug,
5152
onLogMessage(level, message, additionalData) {
5253
console.log(
5354
levelColor[level](" " + level.toUpperCase() + " "),

0 commit comments

Comments
 (0)