2 const shebangRegex = require('shebang-regex');
4 module.exports = (string = '') => {
5 const match = string.match(shebangRegex);
11 const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
12 const binary = path.split('/').pop();
14 if (binary === 'env') {
18 return argument ? `${binary} ${argument}` : binary;