fix: load profile on remote commands

This commit is contained in:
Andras Bacsai
2024-01-11 14:13:43 +01:00
parent 1b6546d26c
commit 34febe670d
4 changed files with 5 additions and 5 deletions

View File

@@ -108,8 +108,8 @@ class ExecuteContainerCommand extends Component
$this->validate();
try {
// Wrap command to prevent escaped execution in the host.
$cmd = 'sh -c "' . str_replace('"', '\"', $this->command) . '"';
$cmd = 'sh -c "if [ -f ~/.profile ]; then . ~/.profile; fi; ' . str_replace('"', '\"', $this->command) . '"';
ray($cmd);
if (!empty($this->workDir)) {
$exec = "docker exec -w {$this->workDir} {$this->container} {$cmd}";
} else {