forked from pattern-lab/patternlab-php-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExportCommand.php
More file actions
53 lines (37 loc) · 1.34 KB
/
ExportCommand.php
File metadata and controls
53 lines (37 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*!
* Console Export Command Class
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*
* Exports patterns w/out pattern lab-specific mark-up. Also moves user-generated static
* assets from public/ to export/
*
*/
namespace PatternLab\Console\Commands;
use \PatternLab\Config;
use \PatternLab\Console;
use \PatternLab\Console\Command;
use \PatternLab\FileUtil;
use \PatternLab\Generator;
use \PatternLab\Timer;
class ExportCommand extends Command {
public function __construct() {
parent::__construct();
$this->command = "export";
Console::setCommand($this->command,"Export Pattern Lab patterns & assets","The export command generates your patterns without Pattern Lab's CSS & JS, copies static assets from <path>public/</path>, and puts all of it in <path>export/</path>.","e");
Console::setCommandOption($this->command,"clean","Don't add any header or footer mark-up to the exported patterns.","To generate clean versions of your patterns:");
}
public function run() {
// set-up required vars
$options = array();
$options["exportFiles"] = true;
$options["exportClean"] = Console::findCommandOption("clean");
$options["moveStatic"] = false;
FileUtil::cleanExport();
$g = new Generator();
$g->generate($options);
FileUtil::exportStatic();
}
}