Skip to content

Commit 144d6da

Browse files
committed
adding event that can be watched for
1 parent d89cf54 commit 144d6da

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/PatternLab/Watcher.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use \PatternLab\Config;
2222
use \PatternLab\Console;
2323
use \PatternLab\Data;
24+
use \PatternLab\Dispatcher;
2425
use \PatternLab\FileUtil;
2526
use \PatternLab\PatternData;
2627
use \PatternLab\Util;
@@ -61,6 +62,12 @@ public function watch($options = array()) {
6162
// make sure a copy of the given options are saved for using when running generate
6263
$this->options = $options;
6364

65+
// set-up the Dispatcher
66+
$dispatcherInstance = Dispatcher::getInstance();
67+
$dispatcherInstance->dispatch("watcher.start");
68+
popen("php /Users/dmolsen/Sites/patternlab-project/dev/development-edition/vendor/pattern-lab/plugin-reload/src/PatternLab/Reload/AutoReloadServer.php", "r");
69+
print "hello world";
70+
6471
// automatically start the auto-refresh tool
6572
// DEPRECATED
6673
/*if ($reload) {

0 commit comments

Comments
 (0)