Skip to content

Commit d51d3cf

Browse files
author
Your Name
committed
#456: Prevent commented commands in bash blocks from being ran
1 parent eb191c1 commit d51d3cf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cecli/coders/base_coder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4018,7 +4018,11 @@ async def run_shell_commands(self):
40184018
self.commands.cmd_running_event.set() # Command finished
40194019

40204020
async def handle_shell_commands(self, commands_str, group):
4021-
commands = command_parser.split_shell_commands(commands_str)
4021+
commands = [
4022+
cmd
4023+
for cmd in command_parser.split_shell_commands(commands_str)
4024+
if cmd and not (isinstance(cmd, str) and cmd.startswith("#"))
4025+
]
40224026

40234027
# Early return if none of the command strings have length after stripping whitespace
40244028
if not any(cmd.strip() for cmd in commands):

0 commit comments

Comments
 (0)