Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatic usage #22

Open
RichardLitt opened this issue Nov 11, 2016 · 0 comments
Open

Programmatic usage #22

RichardLitt opened this issue Nov 11, 2016 · 0 comments

Comments

@RichardLitt
Copy link

I would like to be able to run this programmatically without needing to use the CLI every time, as I maintain a lot of repos and sometimes just want to ensure that they all have the right labels. I am pretty sure this isn't right, as it tends to shut down my Spotify music when I run it (fun!).

const exec = require('child_process').exec
const githubRepos = require('github-repositories')
const orgs = [
  'ipfs',
  'ipld',
  'libp2p',
  'multiformats'
]

orgs.forEach((org) =>
  githubRepos(org).then(data =>
    data.map((item) => {
      exec('labels -c githubLabels.json ' + item.full_name,
        (error, stdout, stderr) => {
          console.log(`stdout: ${stdout}`)
          console.log(`stderr: ${stderr}`)
          if (error !== null) {
            console.log(`exec error: ${error}`)
          }
        }
      )
    })
  )
)

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant