Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion addons/Spock/Commander.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function config($config)
*/
public function shouldRunCommands()
{
return $this->isEnvironmentAllowed() && $this->isEventAllowed();
return $this->isEnvironmentAllowed() && $this->isEventAllowed() && $this->isEventAffectingFiles();
}

/**
Expand All @@ -114,6 +114,16 @@ protected function isEventAllowed()
{
return !in_array(get_class($this->event), array_get($this->config, 'ignore_events', []));
}

/**
* Is event changing files?
*
* @return bool
*/
protected function isEventAffectingFiles()
{
return !empty($this->event->affectedPaths());
}

/**
* Set the commands to be run.
Expand Down