default-browser-id
Advanced tools
Comparing version 1.0.3 to 1.0.4
33
cli.js
#!/usr/bin/env node | ||
'use strict'; | ||
var pkg = require('./package.json'); | ||
var meow = require('meow'); | ||
var defaultBrowserId = require('./'); | ||
var argv = process.argv.slice(2); | ||
function help() { | ||
console.log([ | ||
'', | ||
' ' + pkg.description, | ||
'', | ||
' Example', | ||
' default-browser-id', | ||
' com.apple.Safari' | ||
].join('\n')); | ||
} | ||
meow({ | ||
help: [ | ||
'Example', | ||
' $ default-browser-id', | ||
' com.apple.Safari' | ||
].join('\n') | ||
}); | ||
if (argv.indexOf('--help') !== -1) { | ||
help(); | ||
return; | ||
} | ||
if (argv.indexOf('--version') !== -1) { | ||
console.log(pkg.version); | ||
return; | ||
} | ||
defaultBrowserId(function (err, id) { | ||
if (err) { | ||
throw err; | ||
console.error(err.message); | ||
process.exit(1); | ||
} | ||
@@ -32,0 +19,0 @@ |
@@ -10,2 +10,6 @@ 'use strict'; | ||
module.exports = function (cb) { | ||
if (process.platform !== 'darwin') { | ||
throw new Error('Only OS X systems are supported'); | ||
} | ||
bplist.parseFile(file, function (err, data) { | ||
@@ -16,3 +20,3 @@ if (err) { | ||
var handlers = data && data[0]['LSHandlers']; | ||
var handlers = data && data[0].LSHandlers; | ||
@@ -19,0 +23,0 @@ if (!handlers || handlers.length === 0) { |
{ | ||
"name": "default-browser-id", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Get the bundle identifier of the default browser (OS X). Example: com.apple.Safari", | ||
"license": "MIT", | ||
"bin": { | ||
"default-browser-id": "cli.js" | ||
}, | ||
"repository": "sindresorhus/default-browser-id", | ||
@@ -13,10 +10,8 @@ "author": { | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
"bin": "cli.js", | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"os": [ | ||
"darwin" | ||
], | ||
"scripts": { | ||
@@ -30,4 +25,5 @@ "test": "mocha" | ||
"keywords": [ | ||
"cli-app", | ||
"cli", | ||
"osx", | ||
"mac", | ||
"browser", | ||
@@ -41,8 +37,7 @@ "default", | ||
"identifier", | ||
"uti", | ||
"cli", | ||
"bin" | ||
"uti" | ||
], | ||
"dependencies": { | ||
"bplist-parser": "0.0.6", | ||
"bplist-parser": "^0.1.0", | ||
"meow": "^3.1.0", | ||
"untildify": "^2.0.0" | ||
@@ -49,0 +44,0 @@ }, |
@@ -9,3 +9,3 @@ # default-browser-id [![Build Status](https://travis-ci.org/sindresorhus/default-browser-id.svg?branch=master)](https://travis-ci.org/sindresorhus/default-browser-id) | ||
```sh | ||
``` | ||
$ npm install --save default-browser-id | ||
@@ -19,3 +19,3 @@ ``` | ||
console.log(browserId); | ||
//=> com.apple.Safari | ||
//=> 'com.apple.Safari' | ||
}); | ||
@@ -27,3 +27,3 @@ ``` | ||
```sh | ||
``` | ||
$ npm install --global default-browser-id | ||
@@ -36,3 +36,3 @@ ``` | ||
Example | ||
default-browser-id | ||
$ default-browser-id | ||
com.apple.Safari | ||
@@ -39,0 +39,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4098
3
47
+ Addedmeow@^3.1.0
+ Addedarray-find-index@1.0.2(transitive)
+ Addedbig-integer@1.6.52(transitive)
+ Addedbplist-parser@0.1.1(transitive)
+ Addedcamelcase@2.1.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
- Removedbplist-parser@0.0.6(transitive)
Updatedbplist-parser@^0.1.0