Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Develop SASS locally, upload on change

I'm a front-end developer transitioning from CSS to SASS. I've got Ruby and Compass installed on my local machine, and Compass "watch" is working beautifully.

However, I still end up with local CSS files which I have to manually FTP over to the server after every tiny change, to see what the change made. I would like to automate this.

I did find this thread which suggested using rsync, but I use Windows and I feel setting up rsync would be really difficult.

Is there some way to automate this using Ruby? The workflow I'm trying to get:

  1. I save the SCSS file in VIM.
  2. Compass Watch detects the change and compiles a new CSS file
  3. Some magical tool detects the change to the CSS file, uploads to my server
  4. I switch over to Chrome, hit F5, and see the change

I can do everything, except for step 3. Any ideas? (That don't involve Linux or Mac-only software?)

like image 542
ezuk Avatar asked Sep 19 '11 11:09

ezuk


1 Answers

I disagree with Roy and Adam, When working with Wordpress themes, I develop on a remote dev server. I have a team of people adding content and other edits which update the database, it would be difficult for me as the developer to work locally 100% of the time. Their sql file getting updated with content wouldn't mesh super well after the fact with my sql file (you know theme option settings and what not).

I have avoided using SASS for this reason until now.

My optimal workflow would be to edit my scss file -> auto compile to css -> auto upload to the search (like a upload on save would) -> livereload takes place and I see edits (I can live without this last step).

I haven't attempted this yet but I found this link which seems to be the closest answer thus far.Using SASS with Remote Setup

Side note: Working locally is not always an optimal set up. It isn't an answer and this is about the 8th time I have seen this question with similar answers.

UPDATE: Just tried it without Codekit just sass --watch and it worked great!

ANOTHER UPDATE: I have further modified the way I handle sass and remote development. I know use Sublime, Open my .scss and .css file at the same time. I then use SFTP (a package for sublime) to "Monitor File" which will look for changes to the file outside of directly editing it, I then open up terminal and sass my scss file, now every time I save it complies locally and then the compiled css file auto uploads to my server! Hope that makes sense, maybe I will make a video showing.

like image 113
philhoyt Avatar answered Nov 24 '22 06:11

philhoyt