Can I use Sass with a script package on Windows

In web projects on my local computer, I use a fairly simple Sass setup. In the same folder I have /scss/style.scss and / css / style.css

So, to start Sass while running, I just write this in Ruby Terminal:

cd "C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title" sass --watch scss/style.scss:css/style.css 

Works well, but it's a little cumbersome, so I'm trying to figure out how to make an equivalent with a script package. I tried the following, but it is a complete disaster, and my computer is trying to open an infinite number of Ruby consoles.

 cd "C:\Ruby193\bin" start ruby cd "C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title" sass --watch scss/style.scss:css/style.css exit 

I think what I need to do is to run Ruby in the background, and not open Ruby exe. Does anyone know how, or is it even how Ruby works? Obviously I'm new to Sass, Ruby, and batch scripts, so any insights you can give me will be a big help, thanks.


EDIT: I got it like this

 cd "\Ruby193\bin" sass --watch "C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title\scss\style.scss:C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title\css\style.css" 

I think it should be neat and suspect that sass should have its $ PATH.


EDIT 2: I set the Path variable for Ruby using the following instructions: http://groups.google.com/group/beginning-rails/browse_thread/thread/1c68665013a60081

In my case, the path I needed to add was C: \ Ruby193 \ bin Now I need a single line when I have a script in the root of the web project:

sass --watch scss / style.scss: css / style.css

I could save the part where I changed the directory to the folder location if I wanted to have something that could be run from anywhere on my computer. However, the fact that the script does not indicate the location of the project means that I can simply copy it to any project where I use the same structure.

Is it worth the effort? Ultimately, perhaps yes.

+7
source share
2 answers

Just put your original two teams in your batch file. Thus, the contents of the .bat file will be:

 cd "C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title" sass --watch scss/style.scss:css/style.css 

Just. Such a batch file simply runs each command on each line one by one, as if you were typing each individually.

+4
source

If you are trying to update multiple css files using a batch file as follows:

 scss A.scss ../CSS/A.css scss B.scss ../CSS/B.css echo Done. 

... but only the first scss command line is executed, and the batch file never completes, i.e. you never see "done." Here's why and how to fix it:

scss is actually a buggy batch file that cannot return control to your batch file. I fixed this bypassing the scss batch file and ruby ​​ruby, and this is the scss gem directly as follows:

 ruby C:/Ruby193/bin/scss A.scss ../CSS/A.css ruby C:/Ruby193/bin/scss B.scss ../CSS/B.css echo Done. 

You need your path to point to a ruby, or set the absolute path above.

+2
source

All Articles