first commit
This commit is contained in:
29
build/node_modules/bin-check/index.js
generated
vendored
Normal file
29
build/node_modules/bin-check/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
var spawn = require('child_process').spawn;
|
||||
var executable = require('executable');
|
||||
|
||||
module.exports = function (bin, cmd, cb) {
|
||||
if (typeof cmd === 'function') {
|
||||
cb = cmd;
|
||||
cmd = ['--help'];
|
||||
}
|
||||
|
||||
executable(bin, function (err, works) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!works) {
|
||||
cb(new Error('Couldn\'t execute the `' + bin + '` binary. Make sure it has the right permissions.'));
|
||||
return;
|
||||
}
|
||||
|
||||
var cp = spawn(bin, cmd);
|
||||
|
||||
cp.on('error', cb);
|
||||
cp.on('exit', function (code) {
|
||||
cb(null, code === 0);
|
||||
});
|
||||
});
|
||||
};
|
||||
21
build/node_modules/bin-check/license
generated
vendored
Normal file
21
build/node_modules/bin-check/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
68
build/node_modules/bin-check/package.json
generated
vendored
Normal file
68
build/node_modules/bin-check/package.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"bin-check@2.0.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "bin-check@2.0.0",
|
||||
"_id": "bin-check@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-hvjm9CU4k99g3DFpV/WvAqywWTA=",
|
||||
"_location": "/bin-check",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "bin-check@2.0.0",
|
||||
"name": "bin-check",
|
||||
"escapedName": "bin-check",
|
||||
"rawSpec": "2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bin-wrapper"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/bin-check/-/bin-check-2.0.0.tgz",
|
||||
"_spec": "2.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "https://github.com/kevva"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/bin-check/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"executable": "^1.0.0"
|
||||
},
|
||||
"description": "Check if a binary is working",
|
||||
"devDependencies": {
|
||||
"ava": "^0.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/kevva/bin-check#readme",
|
||||
"keywords": [
|
||||
"binary",
|
||||
"check",
|
||||
"executable",
|
||||
"test"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "bin-check",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kevva/bin-check.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/test.js"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
||||
51
build/node_modules/bin-check/readme.md
generated
vendored
Normal file
51
build/node_modules/bin-check/readme.md
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# bin-check [](https://travis-ci.org/kevva/bin-check)
|
||||
|
||||
> Check if a binary is working by checking its exit code
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save bin-check
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var binCheck = require('bin-check');
|
||||
|
||||
binCheck('/bin/sh', ['--version'], function (err, works) {
|
||||
console.log(works);
|
||||
//=> true
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### binCheck(binary, command, callback)
|
||||
|
||||
#### binary
|
||||
|
||||
Type: `string`
|
||||
|
||||
Path to the binary.
|
||||
|
||||
#### command
|
||||
|
||||
Type: `array`
|
||||
Default: `['--help']`
|
||||
|
||||
Commands to run the binary with.
|
||||
|
||||
#### callback(err, works)
|
||||
|
||||
Type: `function`
|
||||
|
||||
`works` is a `boolean` which returns `true` if the binary is working correctly.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Mårtensson](https://github.com/kevva)
|
||||
Reference in New Issue
Block a user