kriszyp/xstyle — pull request #11 by kfranqueiro (2013-04-02 14:29:33+00:00)
Title: Revise copyOnly logic in package.js to avoid false positives

Currently, the `copyOnly` logic in `package.js` runs various regular expressions against the `filename` argument. However, since that argument includes the entire absolute path to each file being processed, it's possible to result in false positives - for example, if you run a build from underneath a directory containing the word `build` itself, then every resource in xstyle will be marked as `copyOnly`.

This changeset modifies the `copyOnly` logic to check against the `mid` instead, and moves the regular expressions that are being checked into an array for easier maintenance.