Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit a679d46

Browse files
committed
adding cacheBuster support to the watcher
1 parent bf072a6 commit a679d46

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/builder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
// set-up the watch command and options
4848
$console->setCommand("w","watch","Watch for changes and regenerate","The watch command builds Pattern Lab, watches for changes in source/ and regenerates Pattern Lab when there are any.");
4949
$console->setCommandOption("w","p","patternsonly","Watches only the patterns. Does NOT clean public/.","To watch and generate only the patterns:");
50+
$console->setCommandOption("w","n","nocache","Set the cacheBuster value to 0.","To turn off the cacheBuster:");
5051
$console->setCommandOption("w","r","autoreload","Turn on the auto-reload service.","To turn on auto-reload:");
5152

5253
// set-up the version command
@@ -97,7 +98,7 @@
9798

9899
// load the watcher
99100
$w = new PatternLab\Watcher($config);
100-
$w->watch($autoReload,$moveStatic);
101+
$w->watch($autoReload,$moveStatic,$noCacheBuster);
101102

102103
} else if ($command == "v") {
103104

core/lib/PatternLab/Watcher.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct($config = array()) {
3333
* @param {Boolean} decide if the reload server should be turned on
3434
* @param {Boolean} decide if static files like CSS and JS should be moved
3535
*/
36-
public function watch($reload = false, $moveStatic = true) {
36+
public function watch($reload = false, $moveStatic = true, $noCacheBuster = false) {
3737

3838
// automatically start the auto-refresh tool
3939
if ($reload) {
@@ -42,6 +42,8 @@ public function watch($reload = false, $moveStatic = true) {
4242
print "starting page auto-reload...\n";
4343
}
4444

45+
$this->noCacheBuster = $noCacheBuster;
46+
4547
$c = false; // track that one loop through the pattern file listing has completed
4648
$o = new \stdClass(); // create an object to hold the properties
4749
$cp = new \stdClass(); // create an object to hold a clone of $o

0 commit comments

Comments
 (0)