Sass watch command compiles .scss files before full sftp upload

Viewed 762

I use WinSCP to download and edit .scss files and sass on Linux (on the server) to compile them to .css.

After saving the file, I use: sass scss/style.scss css/style.css, which successfully replaces the css file with the compiled sccs.

The problem

I want to skip the part where I return to the command line after editing the scss file, for the sake of automation and saving time.

But, if I use the watch command: sass --watch scss/style.scss:css/style.css to synchronize the two files, alerts about nonexistent css errors pop up:

Change detected to: scss/style.scss
      error scss/style.scss (Line 232: Invalid CSS after "...ht: bold; line-": expected "{", was "")

Note that when the file uploads quicker than usual (sometimes it happens) the watch command does its job, with no errors.

This is because, when the file upload takes time, sass compiles the scss file (on the server) before it is fully uploaded to the remote folder. Thus, it only compiles part of the file, resulting in css errors.

Is there a way to set a timer to the watch command so that it waits a few seconds after it detects changes and before compiling?

Any other way to overcome this is, of course, accepted!!

1 Answers
Related