gaze-run-interrupt

Watch files with gaze and run a sequence of commands. Interrupts the previous sequence if it hasn't completed yet.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gaze-run-interrupt
5162.0.04 years ago8 years agoMinified + gzip package size for gaze-run-interrupt in KB

Readme

Watcher that interrupts the already launched actions in case of new changes.
Similar to gaze-cli except that this package interrupts ongoing actions if necessary, gaze-cli does not support that.

Usage

Create a shell script that calls node with
#!/usr/bin/env node

var gaze_run_interrupt = require('gaze-run-interrupt');

gaze_run_interrupt('{src,test}/**/*.ts', [
    { command: 'tsc' },
    { command: 'mocha', args: ['--reporter', 'min'], cwd: 'dist' }
]);

Arguments

pattern(s)

The first argument accepts a pattern string
gaze_run_interrupt('src/**/*.ts', ...
or and array of pattern strings
gaze_run_interrupt(['src/**/*.ts', '*.sh'], ...

commands

The second argument is an array of command specifier objects, where each object contains
  • command: executable
  • args: array of arguments passed to the executable (optional)
  • cwd: working directory where the command is executed (optional)