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

Commit 06ad322

Browse files
committed
watch _annotations for changes
1 parent e41b595 commit 06ad322

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

core/lib/PatternLab/Watcher.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,27 +142,22 @@ public function watch($reload = false, $moveStatic = true, $noCacheBuster = fals
142142
}
143143

144144
// iterate over the data files and regenerate the entire site if they've changed
145-
$objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(Config::$options["sourceDir"]."/_data/"), \RecursiveIteratorIterator::SELF_FIRST);
145+
$objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(Config::$options["sourceDir"]."/_annotations/"), \RecursiveIteratorIterator::SELF_FIRST);
146146

147147
// make sure dots are skipped
148148
$objects->setFlags(\FilesystemIterator::SKIP_DOTS);
149149

150150
foreach($objects as $name => $object) {
151151

152-
$fileName = str_replace(Config::$options["sourceDir"]."/_data".DIRECTORY_SEPARATOR,"",$name);
152+
$fileName = str_replace(Config::$options["sourceDir"]."/_annotations".DIRECTORY_SEPARATOR,"",$name);
153153
$mt = $object->getMTime();
154154

155155
if (!isset($o->$fileName)) {
156156
$o->$fileName = $mt;
157-
if (($fileName[0] != "_") && $object->isFile()) {
158-
FileUtil::moveStaticFile("_data/".$fileName,"","_data","data");
159-
}
157+
$this->updateSite($fileName,"added");
160158
} else if ($o->$fileName != $mt) {
161159
$o->$fileName = $mt;
162160
$this->updateSite($fileName,"changed");
163-
if (($fileName[0] != "_") && $object->isFile()) {
164-
FileUtil::moveStaticFile("_data/".$fileName,"","_data","data");
165-
}
166161
}
167162

168163
}

0 commit comments

Comments
 (0)