Skip to content

Commit 45f9011

Browse files
dudeofawesomealaddin-add
authored andcommitted
feat(shebang): add support for env's split-string option (#195)
* feat(shebang): add support for env's split-string option This is useful for passing arguments to node * feat(shebang): support all `env` options * feat(shebang): improve regex performance
1 parent 427b0d6 commit 45f9011

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/rules/hashbang.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const getNpmignore = require("../util/get-npmignore")
1313

1414
const NODE_SHEBANG = "#!/usr/bin/env node\n"
1515
const SHEBANG_PATTERN = /^(#!.+?)?(\r)?\n/u
16-
const NODE_SHEBANG_PATTERN = /^#!\/usr\/bin\/env(?: -\S+)*(?: [^\s=-]+=\S+)* node(?: [^\r\n]+?)?\n/u
16+
const NODE_SHEBANG_PATTERN =
17+
/^#!\/usr\/bin\/env(?: -\S+)*(?: [^\s=-]+=\S+)* node(?: [^\r\n]+?)?\n/u
1718

1819
function simulateNodeResolutionAlgorithm(filePath, binField) {
1920
const possibilities = [filePath]

0 commit comments

Comments
 (0)