Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #14 from sroze/check-for-env-variable
Browse files Browse the repository at this point in the history
Check for the specified env variable
  • Loading branch information
sroze committed Jul 6, 2015
2 parents 7adf029 + e0570ff commit 1b3659c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/System/Environ/BashEnvironManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public function __construct(ProcessRunner $processRunner, $file)
*/
public function save(EnvironmentVariable $environmentVariable)
{
$command = 'echo "'.$environmentVariable->getName().'='.$environmentVariable->getValue().'" >> '.$this->file;
$command = 'echo "' . $environmentVariable->getName() . '=' . $environmentVariable->getValue(
) . '" >> ' . $this->file;
$process = new Process($command);

$this->processRunner->run($process);
Expand All @@ -42,7 +43,7 @@ public function save(EnvironmentVariable $environmentVariable)
public function has(EnvironmentVariable $environmentVariable)
{
$process = $this->processRunner->run(
new Process('grep DOCKER_HOST '.$this->file),
new Process(sprintf('grep %s %s', $environmentVariable->getName(), $this->file)),
false
);

Expand Down

0 comments on commit 1b3659c

Please sign in to comment.