Skip to content

Commit

Permalink
Add container->fileExists
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Jul 11, 2023
1 parent b0ad457 commit 24e5b9c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Docker/DockerContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,25 @@ public function logs(): string
return $cmd->getOutput();
}

/**
* Determines if a file exists in the container.
*
* @param string $file_path
* The path to the file to test.
*/
public function fileExists(string $file_path): bool
{
$cmd = $this->executeCliCommand(
array_merge(
$this->containerExecEntryPoint,
['test', '-f', $file_path]
),
null,
null,
);
return $cmd->isSuccessful();
}

/**
* Sets the appropriate TTY flag in the container entry point.
*
Expand Down

0 comments on commit 24e5b9c

Please sign in to comment.