File tree 2 files changed +17
-6
lines changed
2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -284,8 +284,11 @@ def get_command(commandline: str) -> str:
284
284
),
285
285
)
286
286
287
- if command in ["bash" , "sh" ]:
288
- return faillog (commandline , get_generic_script_command (commandline ))
287
+ if command in ["bash" , "sh" , "zsh" ]:
288
+ return faillog (
289
+ commandline ,
290
+ get_generic_script_command (commandline , ignore_switches = ["-p" ]),
291
+ )
289
292
290
293
if PERL_BIN .match (command ):
291
294
return faillog (commandline , get_generic_script_command (commandline ))
@@ -562,9 +565,8 @@ def get_generic_script_command(
562
565
if len (array ) == 2 :
563
566
# vm + script
564
567
return script
565
- if script not in ["brew.rb" , "yarn.js" ]:
568
+ if script not in ["brew.rb" , "brew.sh" , " yarn.js" ]:
566
569
return script
567
- script = os .path .splitext (script )[0 ]
568
570
569
571
subcommand = array [2 ]
570
572
if subcommand .startswith ("-" ):
Original file line number Diff line number Diff line change @@ -503,7 +503,7 @@ def test_get_command_ruby_switches():
503
503
px_commandline .get_command (
504
504
"/usr/bin/ruby -W0 /usr/local/bin/brew.rb install rust"
505
505
)
506
- == "brew install"
506
+ == "brew.rb install"
507
507
)
508
508
509
509
# https://github.com/walles/px/issues/87
@@ -621,7 +621,16 @@ def test_get_homebrew_commandline():
621
621
]
622
622
)
623
623
)
624
- == "brew upgrade"
624
+ == "brew.rb upgrade"
625
+ )
626
+
627
+
628
+ def test_get_bash_brew_sh_commandline ():
629
+ assert (
630
+ px_commandline .get_command (
631
+ "/bin/bash -p /usr/local/Homebrew/Library/Homebrew/brew.sh upgrade"
632
+ )
633
+ == "brew.sh upgrade"
625
634
)
626
635
627
636
You can’t perform that action at this time.
0 commit comments