Projekt

Obecné

Profil

Stáhnout (346 Bajtů) Statistiky
| Větev: | Revize:
1 3a515b92 cagy
'use strict';
2
var shebangRegex = require('shebang-regex');
3
4
module.exports = function (str) {
5
	var match = str.match(shebangRegex);
6
7
	if (!match) {
8
		return null;
9
	}
10
11
	var arr = match[0].replace(/#! ?/, '').split(' ');
12
	var bin = arr[0].split('/').pop();
13
	var arg = arr[1];
14
15
	return (bin === 'env' ?
16
		arg :
17
		bin + (arg ? ' ' + arg : '')
18
	);
19
};