mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 18:23:35 +00:00
feature(cloudcmd) add execon from bower
This commit is contained in:
parent
5fc8127230
commit
1c3a117d02
10 changed files with 83 additions and 314 deletions
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"name": "execon",
|
||||
"version": "1.2.8",
|
||||
"homepage": "https://github.com/coderaiser/execon",
|
||||
"authors": [
|
||||
"coderaiser <mnemonic.enemy@gmail.com>"
|
||||
|
|
@ -21,14 +22,13 @@
|
|||
"test",
|
||||
"tests"
|
||||
],
|
||||
"version": "1.2.5",
|
||||
"_release": "1.2.5",
|
||||
"_release": "1.2.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.2.5",
|
||||
"commit": "ea4e9ed95a445e84298ed670be59e42ce6fbe678"
|
||||
"tag": "v1.2.8",
|
||||
"commit": "7e8900c48fd9262a3a3acaa1c8b6c34ff17aa745"
|
||||
},
|
||||
"_source": "git://github.com/coderaiser/execon.git",
|
||||
"_target": "~1.2.2",
|
||||
"_target": "~1.2.7",
|
||||
"_originalSource": "execon"
|
||||
}
|
||||
|
|
@ -1,3 +1,25 @@
|
|||
2015.10.21, v1.2.8
|
||||
|
||||
fix:
|
||||
- (exec) with do not return value
|
||||
|
||||
feature:
|
||||
- (travis) add
|
||||
- (gitignore) add
|
||||
|
||||
|
||||
2015.10.01, v1.2.7
|
||||
|
||||
fix:
|
||||
- (exec) with: concat arguments
|
||||
|
||||
|
||||
2015.10.01, v1.2.6
|
||||
|
||||
feature:
|
||||
- (exec) with: bind.apply -> function apply
|
||||
|
||||
|
||||
2015.07.21, v1.2.5
|
||||
|
||||
fix:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# Execon [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL]
|
||||
# Execon [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![BuildStatusIMGURL]][BuildStatusURL]
|
||||
|
||||
Patterns of function calls.
|
||||
|
||||
## Install
|
||||
|
|
@ -149,4 +150,5 @@ MIT
|
|||
[BuildStatusURL]: https://travis-ci.org/coderaiser/execon "Build Status"
|
||||
[DependencyStatusURL]: https://gemnasium.com/coderaiser/execon "Dependency Status"
|
||||
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
|
||||
|
||||
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/execon/master.svg?style=flat
|
||||
[BuildStatusURL]: https://travis-ci.org/coderaiser/execon "Build Status"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"name": "execon",
|
||||
"version": "1.2.8",
|
||||
"homepage": "https://github.com/coderaiser/execon",
|
||||
"authors": [
|
||||
"coderaiser <mnemonic.enemy@gmail.com>"
|
||||
|
|
@ -20,6 +21,5 @@
|
|||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"version": "1.2.5"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,14 +29,16 @@
|
|||
/*
|
||||
* return function that calls callback with arguments
|
||||
*/
|
||||
|
||||
exec.with = function(callback) {
|
||||
var args = [].slice.call(arguments),
|
||||
bind = Function.prototype.bind;
|
||||
var slice = Array.prototype.slice,
|
||||
args = slice.call(arguments, 1);
|
||||
|
||||
args[0] = null;
|
||||
|
||||
return bind.apply(callback, args);
|
||||
return function() {
|
||||
var array = slice.call(arguments),
|
||||
all = args.concat(array);
|
||||
|
||||
return callback.apply(null, all);
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -98,10 +100,10 @@
|
|||
type = getType(funcs);
|
||||
|
||||
if (!funcs)
|
||||
throw(Error('funcs' + ERROR));
|
||||
throw Error('funcs' + ERROR);
|
||||
|
||||
if (!callback)
|
||||
throw(Error('callback' + ERROR));
|
||||
throw Error('callback' + ERROR);
|
||||
|
||||
switch(type) {
|
||||
case 'array':
|
||||
|
|
@ -109,7 +111,7 @@
|
|||
|
||||
funcs.forEach(function(func, num) {
|
||||
exec(func, function() {
|
||||
checkFunc(num, arguments, arr);
|
||||
checkFunc(num, arguments);
|
||||
});
|
||||
});
|
||||
break;
|
||||
|
|
@ -128,7 +130,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
function checkFunc(num, data, all) {
|
||||
function checkFunc(num, data) {
|
||||
var args = slice.call(data, 1),
|
||||
isLast = false,
|
||||
error = data[0],
|
||||
|
|
@ -140,17 +142,17 @@
|
|||
|
||||
if (!error)
|
||||
if (length >= 2)
|
||||
all[num] = args;
|
||||
arr[num] = args;
|
||||
else
|
||||
all[num] = args[0];
|
||||
arr[num] = args[0];
|
||||
|
||||
if (!callbackWas && (error || isLast)) {
|
||||
callbackWas = true;
|
||||
|
||||
if (type === 'array')
|
||||
callback.apply(null, [error].concat(all));
|
||||
callback.apply(null, [error].concat(arr));
|
||||
else
|
||||
callback(error, all);
|
||||
callback(error, arr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -176,7 +178,7 @@
|
|||
};
|
||||
|
||||
if (!Array.isArray(funcs))
|
||||
throw(Error('funcs should be array!'));
|
||||
throw Error('funcs should be array!');
|
||||
|
||||
fn = funcs.shift();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
{
|
||||
"name": "execon",
|
||||
"version": "1.2.5",
|
||||
"version": "1.2.8",
|
||||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
||||
"description": "Patterns of function calls",
|
||||
"homepage": "http://github.com/coderaiser/execon",
|
||||
"scripts": {
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/coderaiser/execon.git"
|
||||
|
|
@ -13,5 +16,8 @@
|
|||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"main": "lib/exec.js"
|
||||
"main": "lib/exec.js",
|
||||
"devDependencies": {
|
||||
"tape": "~4.2.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue