This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

osarzola
osarzola

I have a grunt task inside my theme folder to compile my less files, and minify my javascript files, any clue to run "grunt" inside my theme directory after "some" event on my models.

any clue?

public function afterSave(){
        $dynamic = new FileWriter('dynamicvariables');
        if($dynamic->write($this->value)){
            //call grunt
        }
    }

Thanks

wilirius15434
wilirius15434

Isn't this usually done the opposite way? Have your grunt script watch specific files for changes, and then execute whatever commands on any change.

As for running grunt from within PHP, this depends a bit on your OS, and your node setup.

Various answers available via searching "run grunt from php":

http://stackoverflow.com/questions/25598481/how-to-run-grunt-from-a-php-script

http://stackoverflow.com/questions/29732879/execute-a-grunt-task-from-within-a-php-script

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.