Sublime: grunt watch build command.

This commit is contained in:
Artem Sapegin 2012-11-15 10:12:19 +04:00
parent a1fac021c4
commit e02d22d3d3
4 changed files with 36 additions and 1 deletions

View File

@ -1,4 +1,6 @@
[
{ "keys": ["ctrl+d"], "command": "duplicate_line" },
{ "keys": ["ctrl+y"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }
{ "keys": ["ctrl+y"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["ctrl+alt+g"], "command": "run_build", "args": {"build_system": "Packages/User/GruntWatch.sublime-build"} },
{ "keys": ["ctrl+`"], "command": "show_panel", "args": {"panel": "output.exec"} }
]

View File

@ -0,0 +1,5 @@
{
"cmd": ["$packages/User/grunt-watch.sh"],
"file_regex": "^>> Stylus: .*?: (.*?):([0-9]*)",
"shell": true
}

11
sublime/User/RunBuild.py Normal file
View File

@ -0,0 +1,11 @@
# Runs build system specified in `build_system` argument
# Based on http://www.bit-101.com/blog/?p=3439
import sublime_plugin
class RunBuildCommand(sublime_plugin.WindowCommand):
def run(self, build_system):
self.window.run_command("set_build_system", {"file": build_system})
self.window.run_command("build")
self.window.run_command("set_build_system") # Automatic

View File

@ -0,0 +1,17 @@
# Finds directory with `grunt.js` and runs `grunt watch`
cd_to_project_root() {
dir=`pwd`
while [ "$dir" != "/" ]; do
if [ -f "$dir/grunt.js" ]; then
cd "$dir"
break
fi
dir=`dirname "$dir"`
done
}
cd_to_project_root
grunt deploy --no-color --debug
grunt watch --no-color --debug