Skip to content
Open
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
12 changes: 6 additions & 6 deletions bin/good-first-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const cli = require('commander')
const chalk = require('chalk')
const opn = require('open')
const open = require('open')
const gfi = require('libgfi')

const packageJSON = require('../package.json')
Expand All @@ -19,7 +19,7 @@ cli
.option('-a, --auth <token>', 'Authenticate with the GitHub API (increased rate limits)')
.action(async (project, cmd) => {
const options = { // options for libgfi
projects: projects
projects
}

if (cmd.auth) {
Expand All @@ -37,9 +37,9 @@ cli
const issues = await gfi(input, options)

if (issues.length === 0) {
process.exitCode = 0
return console.log(chalk.yellow(`\nNo Good First Issues were found for the GitHub organization, repo, or project ${chalk.white(input)}.\n`))
}
console.log(chalk.yellow(`\nNo Good First Issues were found for the GitHub organization, repo, or project ${chalk.white(input)}.\n`))
return
}

const key = cmd.first ? 0 : Math.floor(Math.random() * Math.floor(issues.length - 1))

Expand All @@ -50,7 +50,7 @@ cli
console.log(output.toString())

if (cmd.open) {
opn(issues[key].url)
open(issues[key].url)
process.exitCode = 0
}
} catch (err) {
Expand Down