css - Edit Menu Action for Bundles/Packages in Sublime Text 2 -


i switching textmate sublime , having trouble getting "custom menu action" work in sublime. menu action line of code co-worker wrote compiles less (css preprocessor) [filename].less , automatically minifies , updates 2 other files upon saving. updated files are: 1. [filename].css , 2. [filename].css.vtl. use cms runs on velocity, , use way throw css onto page reduce http requests. may sound dumb, have enormous multi-tenant instance of on 800 sites, etc. here code:

#!/bin/sh # compiles less , creates css , css.vtl file  # lessc added usr/local/bin dir, add path path=$path:/usr/local/bin  # filename without extension filename=${tm_filepath%.*}  # filetype of current file (will handle multiple . in filepath) filetype=${tm_filepath##*.}  # compile if less document if [ "$filetype" == "less" ];   lessc "$tm_filepath" "$filename".css   lessc "$tm_filepath" "$filename".css.vtl --compress   echo "successfully created following files:"   echo "$filename.css"   echo "$filename.css.vtl" else   echo "not less file: $tm_filepath"   echo "file type $filetype" fi 

i new backend code , not sure how convert python , update less package within sublime. help, , apologies if have missed stackoverflow protocol.. first post.

-esorbma


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -