Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "bash-path", | ||
"description": "Get the path to the bash binary on your OS.", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"homepage": "https://github.com/micromatch/bash-path", | ||
@@ -24,2 +24,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"dependencies": { | ||
"arr-union": "^3.1.0", | ||
"is-windows": "^1.0.1" | ||
@@ -26,0 +27,0 @@ }, |
18
PATH.js
'use strict'; | ||
var union = require('arr-union'); | ||
var path = require('path'); | ||
var defaults = [ | ||
'/bin/bash', | ||
'/sbin/bash', | ||
'/usr/bin/bash', | ||
'/usr/local/bin/bash', | ||
'/usr/local/sbin/bash', | ||
'/usr/sbin/bash', | ||
'/usr/X11/bin/bash', | ||
'/opt/local/bin', | ||
'/opt/local/sbin', | ||
'bash' | ||
]; | ||
module.exports = function(compare) { | ||
var paths = process.env.PATH.split(path.delimiter); | ||
if (paths.indexOf('/usr/local/bin/bash') === -1) paths.push('/usr/local/bin/bash'); | ||
if (paths.indexOf('/bin/bash') === -1) paths.push('/bin/bash'); | ||
if (paths.indexOf('bash') === -1) paths.push('bash'); | ||
var paths = union([], defaults, process.env.PATH.split(path.delimiter)); | ||
if (typeof compare === 'function') { | ||
@@ -11,0 +21,0 @@ paths.sort(compare); |
@@ -25,2 +25,6 @@ # bash-path [![NPM version](https://img.shields.io/npm/v/bash-path.svg?style=flat)](https://www.npmjs.com/package/bash-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/bash-path.svg?style=flat)](https://npmjs.org/package/bash-path) [![NPM total downloads](https://img.shields.io/npm/dt/bash-path.svg?style=flat)](https://npmjs.org/package/bash-path) [![Linux Build Status](https://img.shields.io/travis/micromatch/bash-path.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/bash-path) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/bash-path.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/bash-path) | ||
## Windows | ||
Only works on [Windows 10](https://msdn.microsoft.com/en-us/commandline/wsl/about?f=255&MSPPError=-2147217396) or later. | ||
## About | ||
@@ -27,0 +31,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
6222
63
78
2
+ Addedarr-union@^3.1.0
+ Addedarr-union@3.1.0(transitive)