Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$ octoherd.js [script] [repos...]

Positionals:
script Path to your *.js script
script Path to *.js script. Must be an ES Module.
repos One or multiple arrays in the form of 'repo-owner/repo-name'.
'repo-owner/*' will find all repositories for one owner. '*' will find
all repositories the user has access to [default: []]
Expand All @@ -21,6 +21,7 @@ Options:
--octoherd-token Requires the "public_repo" scope for public repositories,
"repo" scope for private repositories. [string] [required]
--octoherd-cache Cache responses for debugging [boolean] [default: false]
--octoherd-debug Show debug logs [boolean] [default: false]
```

The `script` must export a `script` function which takes three parameters:
Expand Down
5 changes: 5 additions & 0 deletions bin/octoherd.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const argv = yargs
type: "boolean",
default: false,
})
.option("octoherd-debug", {
description: "Show debug logs",
type: "boolean",
default: false,
})
.epilog("copyright 2020").argv;

const { _, $0, script, repos, ...options } = argv;
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ export async function octoherd(
) {
const {
octoherdToken,
octoherdScript,
octoherdCache,
octoherdDebug,
octoherdScript,
octoherdRepos,
...userOptions
} = options;
Expand All @@ -47,7 +48,7 @@ export async function octoherd(
auth: octoherdToken,
userAgent: ["octoherd-cli", VERSION].join("/"),
octoherd: {
debug: true,
debug: octoherdDebug,
onLogMessage(level, message, additionalData) {
console.log(
levelColor[level](" " + level.toUpperCase() + " "),
Expand Down