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