Skip to content

Instantly share code, notes, and snippets.

@omni5cience
Created May 5, 2011 22:36
Show Gist options
  • Save omni5cience/958121 to your computer and use it in GitHub Desktop.
Save omni5cience/958121 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string># This uses the cli for the less compiler
# it should work with either the node module or the ruby gem (which is really old)
# Fucking Textmate doesn't seem to like TM_PATH
less="${TM_PATH:-$TM_SELECTED_FILE}"
css="${less%.less}.css"
# Here's where the magic happens
lessc "$less" &gt; "$css"
echo "lessc $less &gt; $css"
echo "Done"</string>
<key>input</key>
<string>document</string>
<key>keyEquivalent</key>
<string>@s</string>
<key>name</key>
<string>Save to CSS (sh)</string>
<key>output</key>
<string>showAsTooltip</string>
<key>scope</key>
<string>source.css.less</string>
<key>uuid</key>
<string>9F9EEC0F-8976-41A0-A541-B5FA04A04E17</string>
</dict>
</plist>
@omni5cience
Copy link
Author

If anybody stumbles onto this and wonders why I wrote it (rather than just use the existing bundle, which I've actually contributed to), it's because Textmate wasn't finding the less node module.
Since I'm stupid, I did this rather than solve the real problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment