1

I have gulp watch running like so:

gulp.task('watch', () => {
  watch('styles/**/*.scss', () => {
    gulp.start('css');
  });
});

But I have a problem. The workflow looks like this:

  • I edit and save a file in Coda
  • Coda saves by creating a new file in a temporary folder, deleting the original and renaming the temporary file (or something like that)
  • The watch task sees the temporary folder and starts trying to run on the file inside it
  • The CSS build task fails on that file because it gets moved/deleted
  • The temporary folder does not get deleted because this task starts running in it

I have a couple of ways to get the full CSS compiling working fine, but I can't stop the temporary folders hanging around. How do I get rid of these?

Is there a way to make Coda save directly to the file instead of creating these buffer files?

CaribouCode
  • 13,998
  • 28
  • 102
  • 174
  • You could try `watch(['styles/**/*.scss', '!styles/temp/*.scss'], () => ...` and so on. – Leguest May 05 '17 at 13:20
  • @Leguest The temporary folder created is called `(A File Being Saved By Coda)`. How would I ignore that folder name with the spaces? – CaribouCode May 05 '17 at 13:23

1 Answers1

1

In my test it ignored folder with spaces

gulp.task(appName + '-watch-All', function(){
    livereload.listen();
    gulp.watch(['src/' + appName + '/**/*.less', '!src/' + appName + '/content/less/(A File Being Saved By Coda)/*.less'], [appName + '-less-to-css-min']);
    gulp.watch('src/' + appName + '/**/*.js', [appName + '-js-min']);
    gulp.watch('src/*.html', [appName + '-html-min']);
});

Screenshot

Leguest
  • 2,097
  • 2
  • 17
  • 20
  • Appreciate your help. Seems like a logical answer but doesn't seem to do anything to fix the problem for me. The build still crashes because it looks for the temporary file, and the temporary file is still undeleted. – CaribouCode May 05 '17 at 13:37