Skip to content

Commit 59921f0

Browse files
committed
Adding environment variable support
1 parent df9484d commit 59921f0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/Application.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ public function __construct(EmbeddedComposerInterface $embeddedComposer)
8181
parent::__construct('Bldr', $this->getBldrVersion());
8282

8383
$this->addCommands($this->getCommands());
84+
$this->setEnvironmentVariables();
85+
}
86+
87+
/**
88+
* Sets Environment Variables
89+
*/
90+
private function setEnvironmentVariables()
91+
{
92+
putenv('WORK_DIR='.__DIR__);
8493
}
8594

8695
/**
@@ -134,6 +143,7 @@ public function setBuildName()
134143
);
135144
}
136145

146+
putenv('BUILD_NAME='.$name);
137147
static::$BUILD_NAME = $name;
138148
}
139149

src/Call/AbstractCall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ private function replaceTokens(&$option)
321321
}
322322

323323
foreach ($matches as $match) {
324-
$option = str_replace($match[0], Application::$$match[1], $option);
324+
$option = str_replace($match[0], getenv($match[1]), $option);
325325
}
326326
}
327327

0 commit comments

Comments
 (0)