watch.js 616 B

1234567891011121314151617181920212223
  1. /* eslint-env node */
  2. /* eslint import/no-nodejs-modules:0 no-console:0 */
  3. const sane = require('sane');
  4. const {execSync} = require('child_process');
  5. const watcherPy = sane('src/sentry');
  6. const watcherJson = sane('api-docs');
  7. const watchers = [watcherPy, watcherJson];
  8. const makeApiDocsCommand = function () {
  9. console.log('rebuilding...');
  10. output = execSync('make build-api-docs');
  11. console.log(output.toString());
  12. };
  13. for (const w of watchers) {
  14. w.on('change', makeApiDocsCommand);
  15. w.on('add', makeApiDocsCommand);
  16. w.on('delete', makeApiDocsCommand);
  17. }
  18. console.log('rebuilding API docs on changes');