File tree 6 files changed +11
-3
lines changed
6 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ module Shebang
96
96
module_function
97
97
98
98
# A regex to match potential shebang permutations.
99
- NODE_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?node( |$)}
99
+ NODE_SHEBANG_REGEX = %r{^#! ?(?: /usr/bin/(?:env )? )?node( |$)}
100
100
101
101
# The length of the longest shebang matching `SHEBANG_REGEX`.
102
102
NODE_SHEBANG_MAX_LENGTH = T . let ( "#! /usr/bin/env node " . length , Integer )
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ module Shebang
15
15
module_function
16
16
17
17
# A regex to match potential shebang permutations.
18
- PERL_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?perl( |$)}
18
+ PERL_SHEBANG_REGEX = %r{^#! ?(?: /usr/bin/(?:env )? )?perl( |$)}
19
19
20
20
# The length of the longest shebang matching `SHEBANG_REGEX`.
21
21
PERL_SHEBANG_MAX_LENGTH = T . let ( "#! /usr/bin/env perl " . length , Integer )
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ module Shebang
112
112
module_function
113
113
114
114
# A regex to match potential shebang permutations.
115
- PYTHON_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?python(?:[23](?:\. \d {1,2})?)?( |$)}
115
+ PYTHON_SHEBANG_REGEX = %r{^#! ?(?: /usr/bin/(?:env )? )?python(?:[23](?:\. \d {1,2})?)?( |$)}
116
116
117
117
# The length of the longest shebang matching `SHEBANG_REGEX`.
118
118
PYTHON_SHEBANG_MAX_LENGTH = T . let ( "#! /usr/bin/env pythonx.yyy " . length , Integer )
Original file line number Diff line number Diff line change 37
37
#!/usr/bin/env node
38
38
a
39
39
b
40
+ #!node
40
41
c
41
42
EOS
42
43
file . flush
53
54
#!#{ HOMEBREW_PREFIX /"opt/node@18/bin/node" }
54
55
a
55
56
b
57
+ #!#{ HOMEBREW_PREFIX /"opt/node@18/bin/node" }
56
58
c
57
59
EOS
58
60
end
Original file line number Diff line number Diff line change 36
36
#!/usr/bin/env perl
37
37
a
38
38
b
39
+ #!perl
39
40
c
40
41
EOS
41
42
file . flush
52
53
#!#{ HOMEBREW_PREFIX } /opt/perl/bin/perl
53
54
a
54
55
b
56
+ #!#{ HOMEBREW_PREFIX } /opt/perl/bin/perl
55
57
c
56
58
EOS
57
59
end
70
72
#!#{ expected_shebang }
71
73
a
72
74
b
75
+ #!#{ expected_shebang }
73
76
c
74
77
EOS
75
78
end
Original file line number Diff line number Diff line change 37
37
#!/usr/bin/python2
38
38
a
39
39
b
40
+ #!python
40
41
c
41
42
EOS
42
43
file . flush
55
56
#!#{ HOMEBREW_PREFIX } /opt/[email protected] /bin/python3.11
56
57
a
57
58
b
59
+ #!#{ HOMEBREW_PREFIX } /opt/[email protected] /bin/python3.11
58
60
c
59
61
EOS
60
62
end
68
70
#!/usr/bin/env python3
69
71
a
70
72
b
73
+ #!/usr/bin/env python3
71
74
c
72
75
EOS
73
76
end
You can’t perform that action at this time.
0 commit comments