Created
January 21, 2019 15:26
-
-
Save stefpe/070336074da2fcdf19c0cd3bf4953bc3 to your computer and use it in GitHub Desktop.
File watcher with robo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once './vendor/autoload.php'; | |
/** | |
* This is project's console commands configuration for Robo task runner. | |
* | |
* @see http://robo.li/ | |
*/ | |
class RoboFile extends \Robo\Tasks | |
{ | |
/** | |
* Watch specific project files. | |
* @return \Robo\Result | |
*/ | |
public function watchProject() | |
{ | |
return $this->taskWatch() | |
->monitor( | |
'src', | |
function (\Lurker\Event\FilesystemEvent $fse) { | |
$this->io()->note((string)$fse->getResource()); | |
$this->taskPhpUnit()->run(); | |
}, | |
\Lurker\Event\FilesystemEvent::DELETE | |
)->run(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment