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.8 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.7 node_modules/shebang-command/index.js
immosquare-cleaner-0.1.6 node_modules/shebang-command/index.js
decidim-0.26.8 packages/eslint-config/node_modules/shebang-command/index.js
appmap-0.72.2 ./node_modules/shebang-command/index.js
appmap-0.72.1 ./node_modules/shebang-command/index.js
appmap-0.72.0 ./node_modules/shebang-command/index.js
appmap-0.71.0 ./node_modules/shebang-command/index.js
appmap-0.70.2 ./node_modules/shebang-command/index.js
appmap-0.70.1 ./node_modules/shebang-command/index.js
appmap-0.70.0 ./node_modules/shebang-command/index.js
appmap-0.69.0 ./node_modules/shebang-command/index.js
appmap-0.68.2 ./node_modules/shebang-command/index.js
appmap-0.68.1 ./node_modules/shebang-command/index.js
appmap-0.68.0 ./node_modules/shebang-command/index.js
appmap-0.67.1 ./node_modules/shebang-command/index.js
appmap-0.67.0 ./node_modules/shebang-command/index.js
appmap-0.66.2 ./node_modules/shebang-command/index.js
appmap-0.66.1 ./node_modules/shebang-command/index.js
appmap-0.66.0 ./node_modules/shebang-command/index.js