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

Watching for Changes and Auto Regenerating Patterns

Dave Olsen edited this page Jul 9, 2013 · 6 revisions

The PHP version of Pattern Lab has the ability to watch for changes to patterns and select files. When these files change, it will automatically rebuild the entire Pattern Lab website. You simply make your changes, save the file, and the PHP version of Pattern Lab will take care of the rest.

How to Set-up the Watch

To set-up the watch on Mac OS X you can do the following:

  1. Open scripts/
  2. Double-click startAutoRegenerate.command

You can also start the watch from the command line. To do so open Terminal and navigate to the root of the patternlab-php directory. Type:

php builder/builder.php -w

How to Stop the Watch

To stop watching files on Mac OS X you can pressCTRL+C in the Terminal window where the process is running.

The Default Files That Are Watched

By default, the PHP version of Pattern Lab monitors the following files:

  • all of the patterns under source/patterns
  • source/data/data.json
  • source/data/listitems.json
  • source/css/styles.css

Adding Files to Be Watched

You can add additional files to be watched by editing config/config.ini. For example, you might want to track separate CSS files. In config/config.ini you will want to add the source files to wf and the location where the source files should be moved to to mf. Make sure to separate file names with a comma.

For example, let's say we wanted to watch a new CSS file, generated by Sass, that was at source/css/blueberry.css. When it was generated/saved we want the file moved to public/css/orange.css. To do this we'd modify our config/config.ini like so:

wf = "css/style.css,css/blueberry.css"
mf = "css/style.css,css/orange.css"

When blueberry.css was saved the PHP version of Pattern Lab would move it to public/css/orange.css.

Clone this wiki locally