Skip to content

Commit

Permalink
Merge pull request #20 from kinglozzer/pulls/templatefile-config
Browse files Browse the repository at this point in the history
Make DNEnvironment.template_file configurable
  • Loading branch information
Sean Harvey committed Sep 15, 2014
2 parents b7782f7 + 8b68790 commit f77da4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code/model/DNEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class DNEnvironment extends DataObject {
* If not set, the default 'environment.template' from the module
* root is used
*
* @config
* @var string
*/
private static $template_file = '';
Expand Down Expand Up @@ -645,8 +646,8 @@ public function onBeforeWrite() {

// Create a basic new environment config from a template
if($this->config()->get('allow_web_editing') && !$this->envFileExists() && $this->Filename && $this->CreateEnvConfig) {
if(self::$template_file) {
$templateFile = self::$template_file;
if($this->config()->template_file) {
$templateFile = $this->config()->template_file;
} else {
$templateFile = BASE_PATH.'/deploynaut/environment.template';
}
Expand Down

0 comments on commit f77da4a

Please sign in to comment.