Skip to content

Commit

Permalink
chore: changed logger and rest repo target
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed May 22, 2024
1 parent 302ef17 commit ceb9a68
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 123 deletions.
4 changes: 2 additions & 2 deletions src/handlers/command-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export class CommandParser {
// Overrides to make sure we do not use TTY outputs as they are not available outside Node.js env
program.configureOutput({
writeOut(str: string) {
console.log(str);
context.logger.info(str);
},
writeErr(str: string) {
console.error(str);
context.logger.error(str);
},
getErrHelpWidth(): number {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/query-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ User information for ${username} was not found.
issue_number: payload.issue.number,
});
} catch (e) {
console.error("Could not query user.", e);
context.logger.error("Could not query user.", e);
}
}
3 changes: 1 addition & 2 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ export async function run(inputs: PluginInputs, env: Env) {
try {
await commandParser.parse(args);
} catch (e) {
console.log("error", e);
context.logger.error("error", e);
if (e instanceof CommanderError) {
if (e.code !== "commander.unknownCommand") {
console.error(e);
await octokit.issues.createComment({
body: `\`\`\`
Failed to run command-query-user.
Expand Down
Loading

0 comments on commit ceb9a68

Please sign in to comment.