Completed
Push — cecil ( 66a45a )
by Arnaud
02:09
created

Clean::processCommand()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 3
nc 4
nop 0
1
<?php
2
/*
3
 * This file is part of the PHPoole/Cecil package.
4
 *
5
 * Copyright (c) Arnaud Ligny <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Cecil\Command;
12
13
use PHPoole\PHPoole;
14
15
class Clean extends AbstractCommand
16
{
17
    public function processCommand()
18
    {
19
        //delete output dir
20
        $outputDir = $this->getPHPoole()->getConfig()->get('output.dir');
21
        if ($this->fs->exists($this->getPath().'/'.$outputDir)) {
22
            $this->fs->remove($this->getPath().'/'.$outputDir);
23
            $this->wlDone(sprintf("Output directory '%s' removed.", $outputDir));
24
        }
25
        // delete server temp files
26
        if ($this->fs->exists($this->getPath().'/'.Serve::$tmpDir)) {
27
            $this->fs->remove($this->getPath().'/'.Serve::$tmpDir);
28
            $this->wlDone('Temporary server files deleted.');
29
        }
30
        exit(0);
31
    }
32
}
33