Sha256: d98c3aa373c72016e990a723e919af495423bc4ac1daa0736c5f45fac0418d7f

Contents?: true

Size: 387 Bytes

Versions: 65

Compression:

Stored size: 387 Bytes

Contents

'use strict';
const shebangRegex = require('shebang-regex');

module.exports = (string = '') => {
	const match = string.match(shebangRegex);

	if (!match) {
		return null;
	}

	const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
	const binary = path.split('/').pop();

	if (binary === 'env') {
		return argument;
	}

	return argument ? `${binary} ${argument}` : binary;
};

Version data entries

65 entries across 65 versions & 5 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.50 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.49 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.48 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.47 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.46 node_modules/shebang-command/index.js
pcp-server-ruby-sdk-0.0.6 node_modules/shebang-command/index.js
pcp-server-ruby-sdk-0.1.0 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.45 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.44 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.43 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.42 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.41 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.40 node_modules/shebang-command/index.js
wice_grid-7.1.0 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.39 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.38 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.32 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.31 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.30 node_modules/shebang-command/index.js