|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | /*! |
4 | | - * Pattern Lab Builder CLI - v0.3.6 |
| 4 | + * Pattern Lab Builder CLI - v0.6.0 |
5 | 5 | * |
6 | 6 | * Copyright (c) 2013 Dave Olsen, http://dmolsen.com |
7 | 7 | * Licensed under the MIT license |
|
10 | 10 | * |
11 | 11 | * php builder.php -g |
12 | 12 | * Iterates over the 'source' directories & files and generates the entire site a single time. |
| 13 | + * It also cleans the 'public' directory. |
13 | 14 | * |
14 | 15 | * php builder.php -w |
15 | 16 | * Generates the site like the -g flag and then watches for changes in the 'source' directories & |
|
26 | 27 | require __DIR__."/lib/Mustache/Autoloader.php"; |
27 | 28 | Mustache_Autoloader::register(); |
28 | 29 |
|
| 30 | +// load css rule saver |
| 31 | +require __DIR__."/lib/css-rule-saver/css-rule-saver.php"; |
| 32 | + |
29 | 33 | // make sure this script is being accessed from the command line |
30 | 34 | if (php_sapi_name() == 'cli') { |
31 | 35 |
|
32 | | - $args = getopt("gw"); |
| 36 | + $args = getopt("gwc"); |
33 | 37 |
|
34 | 38 | if (isset($args["g"])) { |
35 | 39 |
|
36 | 40 | // initiate the g (generate) switch |
37 | 41 |
|
38 | 42 | // iterate over the source directory and generate the site |
39 | 43 | $g = new Generatr(); |
40 | | - $g->generate(); |
| 44 | + |
| 45 | + // check to see if CSS for patterns should be parsed & outputted |
| 46 | + (isset($args["c"])) ? $g->generate(true) : $g->generate(); |
| 47 | + |
41 | 48 | print "your site has been generated...\n"; |
42 | 49 |
|
43 | | - } elseif (isset($args["w"])) { |
| 50 | + } else if (isset($args["w"])) { |
44 | 51 |
|
45 | 52 | // initiate the w (watch) switch |
46 | 53 |
|
|
60 | 67 | print "\n"; |
61 | 68 | print "Usage:\n\n"; |
62 | 69 | print " php ".$_SERVER["PHP_SELF"]." -g\n"; |
63 | | - print " Iterates over the 'source' directories & files and generates the entire site a single time.\n\n"; |
| 70 | + print " Iterates over the 'source' directories & files and generates the entire site a single time.\n"; |
| 71 | + print " It also cleans the 'public' directory.\n\n"; |
64 | 72 | print " php ".$_SERVER["PHP_SELF"]." -w\n"; |
65 | 73 | print " Generates the site like the -g flag and then watches for changes in the 'source' directories &\n"; |
66 | 74 | print " files. Will re-generate files if they've changed.\n\n"; |
|
0 commit comments