Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime SFTP - Upload compiled css when sass file saved

I'm developing html/css in Sublime. I'm writing my css with sass and using Sublime's build system to generate the css file on file save. It's also configured to upload on save using the SFTP plugin.

My problem is that the generated css file doesn't get uploaded as that isn't the file I've directly saved. I've tried to see if there is a way for the SFTP plugin to upload all files that have been modified locally, but it doesn't seem to support that.

Is there anything I can do to achieve this?

like image 295
Ryan Avatar asked Jan 31 '14 22:01

Ryan


4 Answers

I'll throw my solution into the mix, just in case anyone stumbles on this as I did and wants to stick as close to a solely ST-based workflow as possible. If you're using the SFTP package for ST, there is an option to monitor files for external saves.

enter image description here

Unfortunately, using the ST build system to compile my SASS somehow slipped by SFTP. SASS CLI's watch utility, however, triggers the upload just fine. Once set, presuming the target file remains open, SFTP will upload it after each build.

To recap,

  1. Open target file, followed by the command palette. Enter SFTP: Monitor File (Upload on External Save)

  2. Start whatever CLI watch/build utility you prefer, for me, Sass: sass --watch app.scss:app.css

  3. Leave target file open, otherwise the SFTP monitor seems to cease.

Enjoy!

NOTE: You can also enable file monitoring from the sidebar by right clicking on the file you wish to monitor and selecting...

Sidebar Dialog Option for enabling File Monitoring

like image 96
EranSch Avatar answered Nov 10 '22 17:11

EranSch


SFTP has an option for that. Search on Package control for SFTP > Monitor file. Once selected, "SFTP monitoring" will appear on bottom command info. Now on every save, both sass and complied css will be uploaded to their respetive folders.

like image 29
unpezvivo Avatar answered Nov 10 '22 19:11

unpezvivo


Because Sublime SFTP doesn't seem to support this, you'll probably have to go a different route.

I would recommend using something that monitors your css folder, and automatically uploads any changes to your server. Using good ol' fashion WinSCP (if you're on Windows) would work, but any way to sync folders works.

http://winscp.net/eng/docs/task_keep_up_to_date

like image 39
MattDiamant Avatar answered Nov 10 '22 19:11

MattDiamant


I ended up scrapping SFTP and using ExpanDrive. Fits my workflow perfectly.

like image 45
Ryan Avatar answered Nov 10 '22 18:11

Ryan