Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ModularPipelines/Context/FileInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public virtual async Task<CommandResult> InstallFromFileAsync(InstallerOptions o
}, cancellationToken).ConfigureAwait(false);
}

await _bash.Command(new BashCommandOptions($"chmod u+x {options.Path}"), cancellationToken).ConfigureAwait(false);
var escapedPath = options.Path.Replace("'", "'\\''");

Copilot AI Jan 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The escaping logic is duplicated from the existing EscapeShellArgument utility method in PredefinedInstallers.cs (line 194). Consider extracting this method to a shared utility class to maintain consistency and follow the DRY principle. The existing method at PredefinedInstallers.cs:194-199 uses the same escaping pattern and includes documentation explaining the approach.

Suggested change
var escapedPath = options.Path.Replace("'", "'\\''");
var escapedPath = PredefinedInstallers.EscapeShellArgument(options.Path);

Copilot uses AI. Check for mistakes.
await _bash.Command(new BashCommandOptions($"chmod u+x '{escapedPath}'"), cancellationToken).ConfigureAwait(false);
Comment on lines +31 to +32

Copilot AI Jan 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix for shell escaping lacks test coverage. The existing BashTests.cs file covers basic bash command execution but doesn't test file paths with special characters (spaces, quotes, etc.). Consider adding tests that verify the chmod command works correctly with file paths containing spaces and single quotes, as described in the PR test plan.

Copilot uses AI. Check for mistakes.

return await _bash.FromFile(new BashFileOptions(options.Path), cancellationToken).ConfigureAwait(false);
}
Expand Down
Loading