Skip to content

Instantly share code, notes, and snippets.

@DerZyklop
Created August 5, 2014 09:31
Show Gist options
  • Save DerZyklop/25c83210515fade60d20 to your computer and use it in GitHub Desktop.
Save DerZyklop/25c83210515fade60d20 to your computer and use it in GitHub Desktop.
Opens projects bugs-url in browser from commandline. Infos here: http://der-zyklop.de/blog/node-js-open-issues-url-from-package-json-via-commandline
#! /usr/bin/env node
var file = require(process.cwd()+'/package.json');
var pkg = JSON.parse(JSON.stringify(file));
var spawn = require('child_process').spawn;
if ( pkg.bugs.url ) {
spawn('open', [pkg.bugs.url]);
} else {
console.error("--------------------------------------");
console.error("Couldnt find the bugs-url for "+pkg.name);
console.error("--------------------------------------");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment