syntax.us
Let the syntax do the talking
![]() |
Blog Contact Posts Questions Tags Hire Me |
Question:
How to use ShellJS?
I use Lineman to build websites. It is a framework technology which depends on Node.js An important component of Lineman is Grunt which offers a script driven administrative interface. When I work with Grunt I often enhance it with a module named ShellJS. ShellJS allows me to write Grunt tasks which can call shell commands. Assuming that I have followed this post lineman_angular_install , to start a Lineman-Angular app on my laptop, an example of a shell script I call from Grunt is displayed below:
The above script transforms Haml files into HTML files.
It assumes the Haml files are in app/haml_templates and that the HTML files are in app/templates. To call the above shell-script, I add syntax to a file in the tasks folder of my lineman app:
The above script depends on ShellJS which I install with this shell command:
Also I add syntax to config/application.coffee:
The above syntax ensures that Grunt will call haml.bash at appropriate times as I enhance my Lineman app.
A simple post which describes installation of Haml is listed below: ruby_gem_home_gem_path I learned how to use Haml by studying this content: http://haml.info/docs.html I learned how to write syntax for tasks/haml_bash.coffee by studying this content: http://gruntjs.com/creating-tasks https://github.com/arturadib/shelljs#coffeescript I learned how to write syntax for config/application.coffee by studying this content: http://linemanjs.com/#configuring-lineman When I mix Node.js , Lineman , Grunt , CoffeeScript , Haml , and ShellJS , I am happy with the efficiency of my development environment. |
syntax.us Let the syntax do the talking |
Blog Contact Posts Questions Tags Hire Me |