Nubzor
Nubzor

Reputation: 522

Atom action performed on save

I am using the Atom.io editor. I would like to perform an action while saving file.

Namely I would like to perform bash commend...

Is there a way to do it? Or maybe there is a plug-in which allow to run gulp on save css/js file?

Upvotes: 0

Views: 193

Answers (1)

andorx
andorx

Reputation: 349

In order to create watcher that will spy on CSS/JS files then perform an action, you can use gulp-watch. For example:

gulp.watch([
    path.join(conf.paths.src, '/sass/**/*.css'),
    path.join(conf.paths.src, '/sass/**/*.scss')
], function(event) {
    if(isOnlyChange(event)) {
        gulp.start('styles-reload');
    } else {
        ...
    }
});

Upvotes: 2

Related Questions