Created
August 5, 2014 09:31
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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