mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #20157 from Homebrew/shebang-regex
language/*: fix `*_SHEBANG_REGEX` anchors
This commit is contained in:
commit
d590e398fc
@ -96,7 +96,7 @@ module Language
|
||||
module_function
|
||||
|
||||
# A regex to match potential shebang permutations.
|
||||
NODE_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?node( |$)}
|
||||
NODE_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?node( |$)}
|
||||
|
||||
# The length of the longest shebang matching `SHEBANG_REGEX`.
|
||||
NODE_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env node ".length, Integer)
|
||||
|
@ -15,7 +15,7 @@ module Language
|
||||
module_function
|
||||
|
||||
# A regex to match potential shebang permutations.
|
||||
PERL_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?perl( |$)}
|
||||
PERL_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?perl( |$)}
|
||||
|
||||
# The length of the longest shebang matching `SHEBANG_REGEX`.
|
||||
PERL_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env perl ".length, Integer)
|
||||
|
@ -15,7 +15,7 @@ module Language
|
||||
module_function
|
||||
|
||||
# A regex to match potential shebang permutations.
|
||||
PHP_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?php( |$)}
|
||||
PHP_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?php( |$)}
|
||||
|
||||
# The length of the longest shebang matching `SHEBANG_REGEX`.
|
||||
PHP_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env php ".length, Integer)
|
||||
|
@ -112,7 +112,7 @@ module Language
|
||||
module_function
|
||||
|
||||
# A regex to match potential shebang permutations.
|
||||
PYTHON_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?python(?:[23](?:\.\d{1,2})?)?( |$)}
|
||||
PYTHON_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?python(?:[23](?:\.\d{1,2})?)?( |$)}
|
||||
|
||||
# The length of the longest shebang matching `SHEBANG_REGEX`.
|
||||
PYTHON_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env pythonx.yyy ".length, Integer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user