Skip to content

Instantly share code, notes, and snippets.

@zzarcon
Created October 14, 2017 13:21
Show Gist options
  • Save zzarcon/38bfc19c2f128d49f37f5eb4840f918e to your computer and use it in GitHub Desktop.
Save zzarcon/38bfc19c2f128d49f37f5eb4840f918e to your computer and use it in GitHub Desktop.
import runWhen from 'run-when';
runWhen([
{
glob: ['app/components/index.js', 'app/__tests__/**'],
task(paths) {
console.log('This will be called!');
}
},
{
glob: ['!package.json'],
task(paths) {
return Promise.resolve('You can return a promise from your task');
}
},
{
// Optionally pass changed files
changedFiles: () => Promise.resolve(['app/index.js', 'app/components/header.jsx']),
glob: ['app/components/**'],
task(paths) {
console.log(paths === ['app/components/header.jsx']);
}
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment