xbar-plugins icon indicating copy to clipboard operation
xbar-plugins copied to clipboard

re: GitHub pull-requests

Open stefanosaittamrf opened this issue 10 years ago • 2 comments

FAO: (@jasminb)

For big output this dosn't work.

Argument list too long

I tried to fix myself redirecting the output into a file, and read the file using node but with no success because of some Permission Issues.

FILE_NAME="json"

curl -s -u $GITHUB_USER:$GITHUB_ACCESS_TOKEN $GITHUB_REPO_API/$GITHUB_REPO_OWNER/$GITHUB_REPO/pulls > $FILE_NAME
# JavaScript used to parse result JSON and extract titile/url/submitter of pull request
JS='var fs = require("fs"); fs.readFile("'$FILE_NAME'", "utf-8", function(err,data) {if(prJson=JSON.parse(data),prJson.length>0)for(console.log("♣︎ "+prJson.length+" PRs"),console.log("---"),i=0;i<prJson.length;i++)console.log("▸ #"+prJson[i].number+" "+prJson[i].title+" ("+prJson[i].user.login+") | href="+prJson[i].html_url);""; })'

# Fetch and parse open pull request from GitHub
node -pe "$JS"

This works fine in terminal, but not in bitbar. Let me know if you know how to solve the permission probelm :shipit:

stefanosaittamrf avatar Jun 23 '16 11:06 stefanosaittamrf

This has been replaced with a new script pull-requests.5m.js. Can you verify if this is still an issue for you with the updated version?

tresni avatar Aug 10 '16 22:08 tresni

@tresni I see that one, i refactored mine in ES6 starting form there. If you want open a PR there. I'm not about to publish this because have a dependecy with https://github.com/sindresorhus/bitbar but i guess you should take a look of that 👓

stefanosaittamrf avatar Aug 11 '16 00:08 stefanosaittamrf