Skip to content

Commit e8577a7

Browse files
author
Sean Harvey
committed
Merge pull request #47 from tractorcow/pulls/remove-pipeline
BUG Pipelines can now be removed
2 parents a794097 + 33d7670 commit e8577a7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

code/model/DNEnvironment.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,14 @@ protected function writeConfigFile() {
974974
* Write the pipeline config file to filesystem
975975
*/
976976
protected function writePipelineFile() {
977-
if($this->config()->get('allow_web_editing') && $this->PipelineConfig) {
978-
file_put_contents($this->getPipelineFilename(), $this->PipelineConfig);
977+
if(!$this->config()->get('allow_web_editing')) return;
978+
$path = $this->getPipelineFilename();
979+
if($this->PipelineConfig) {
980+
// Update file
981+
file_put_contents($path, $this->PipelineConfig);
982+
} elseif($this->isChanged('PipelineConfig') && file_exists($path)) {
983+
// Remove file if deleted
984+
unlink($path);
979985
}
980986
}
981987

0 commit comments

Comments
 (0)