include node modules

This commit is contained in:
Opportunity
2019-09-30 17:55:21 +08:00
Unverified
parent cf5188b310
commit 7c2a9b6f1c
371 changed files with 74540 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
'use strict';
var shebangRegex = require('shebang-regex');
module.exports = function (str) {
var match = str.match(shebangRegex);
if (!match) {
return null;
}
var arr = match[0].replace(/#! ?/, '').split(' ');
var bin = arr[0].split('/').pop();
var arg = arr[1];
return (bin === 'env' ?
arg :
bin + (arg ? ' ' + arg : '')
);
};